data-src=../../../includes/saas-only.md

Email triggering through the REST API

Previously, you could only send emails when events were triggered, such as during customer registration or order purchase. In Adobe Commerce as a Cloud Service, you can send emails through the REST API on demand by specifying a template ID, recipient email, and template variables.

data-variant=info
data-slots=text
Currently, only newly created, custom templates can be sent. Predefined and system templates are not supported.

The V1/custom-email/send endpoint allows third-party systems, such as integrations and external services, to send emails on demand by specifying:

data-variant=info
data-slots=text
Email is sent synchronously using the current store scope and the default From email address or the email address defined for templates.

REST contract

The following section explains how to send transactional emails on demand using the REST API.

Endpoint

Request body

Example request

{
  "templateId": 5,
  "recipientEmail": "john@example.com",
  "replyToEmail": "support@example.com",
  "variables": {
    "customer_name": "John",
    "order_id": "100000123",
    "delivery_date": "Feb 15"
  }
}

Success response (HTTP 200)

The API returns HTTP 200 on successful send. The reply_to_email field is only present in the response when a replyToEmail value was supplied in the request.

{
  "message": "Email accepted for delivery",
  "reference_id": "a1b2c3d4e5f6-1707571800",
  "recipient_email": "john@example.com",
  "reply_to_email": "support@example.com",
  "template_id": 5,
  "template_code": "order_update_notification"
}

Error responses

Supported template scenarios

The following template features are supported in both the email body and the template subject:

data-variant=info
data-slots=text
The template subject also supports custom variables. Use var variableName and other syntax as described in the following section.