Email history and previews
Resend a stored email
/a/Email_resend
Submit an existing tenant mail record to the mail service again.
When to use this endpoint
Use a mail-history ID, not an email-template or notification-rule ID. Check delivery/history before retrying an uncertain request.
Authentication and permissions
Use signed API-key authentication or a logged-in CRM session on the account’s routed host. API keys act as their owner; normal session requests need dispatcher CSRF protection where configured. Tenant data is selected from the authenticated account.
The handler has no additional page-action/Role check. A CRM2 screen hiding a control does not add such a server guard, and CRM2 role names must not be assumed to apply to CRM1. The dispatcher has no dedicated object-scope mapping for this namespace.
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
id | Integer-compatible | Yes | Must integer-convert above zero and name a tenant mail row. No sent/failed status prerequisite is enforced. |
Example request
$result = FM_api('Email_resend', ['id'=>'18']);
Example response
{
"ok": 1
}
Application errors normally remain JSON responses with HTTP 200; inspect error/warning keys. Numeric driver values can be strings.
Errors and unusual responses
| Response | Condition |
|---|---|
{"error":"not logged in"} | No authenticated tenant context is available. Invalid signed credentials can be rejected by the dispatcher before the handler runs. |
{"error":"missing or invalid parameter: id"} | No positive integer-compatible ID. |
{"error":"email not found"} | No stored mail row matches. |
{"error":"Missing parameters: Invoice ID"} | The invoice branch has a present invalid object ID. |
Legacy application errors may be returned with HTTP 200. Check the decoded response for error, not only the HTTP status.
Behaviour and edge cases
- Copies stored type, metadata, linked customer/type, original user and recipients. Body comes from meta.body, falling back to email_body. template prefers meta.template over email_template and is supplied to the mail service under both template ID aliases.
- For mail type 4 with obj_type=3, a present positive obj_id is forwarded as invoice_id. Present nonpositive invoice obj_id produces Missing parameters: Invoice ID; other object/type combinations do not add it.
Side effects
- Calls the configured mail service, potentially creating another queue/history entry and delivering to the original recipients. It does not change the old row into a verified new delivery result; no transaction spans service delivery.
See it in Fieldmotion
CRM1
Customer, Asset and User Email tabs offer Resend on a history row.
CRM2
Use Resend in the mail-history widget or Customer/User/Asset Email history.
Related endpoints
Email_getRequestedDetails— Continue the related read/write workflow.Emails_getDataTable— Continue the related read/write workflow.