When to use this endpoint

Use EmailTemplate_get to populate the template editor or load a selected template body and subject into an email-composition workflow.

Authentication and permissions

The request must authenticate with signed API-key fields or a logged-in CRM session. The handler requires login and performs no additional page or role-permission check.

The read or write is limited to the authenticated tenant. Notice endpoints that say “current user” use the authenticated session user ID within that tenant.

Parameters

ParameterTypeRequiredDescription
idInteger-compatibleYesTemplate ID. Values are integer-converted and must be at least 1.

Example request

$template = FM_api('EmailTemplate_get', [
	'id' => '152004',
]);

Example response

{
  "id": "152004",
  "name": "Service completion email",
  "body": "<p>Hello {{CUSTOMER_NAME}}</p>",
  "archived": "0",
  "from_email": "service@example.test",
  "is_default": "0",
  "subject": "Your service report",
  "type": "1",
  "meta": "[]"
}

The endpoint returns raw database column names and values. In particular, from_email and is_default are snake-case and meta remains encoded JSON text.

Errors and unusual responses

ResponseCondition
{"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"}id is absent, zero, blank, or converts below 1.
falseNo template has the numeric 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

  • All stored columns are returned; there is no field selection, pagination, or derived data.
  • Archived templates are returned. The endpoint does not limit results by template type or default status.

See it in Fieldmotion

CRM1

CRM1 calls this from Settings → Email Templates and from email dialogs for jobs, invoices, quotes, customer orders, purchase orders, and other messages. Selecting a template loads its body and subject.

CRM2

CRM2 uses this endpoint in email-template settings and customer-order email composition. CRM2 customer email history uses the mapped detail route instead.

Related endpoints