Send one of the store's Handlebars e-mail templates through the store's own SMTP setup. Free (not metered).
POST/api/mailing/sendwrites data
Sends a generic email using SMTP.
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
store | string | required | Preferred in header, but store ID can be also used in request body. |
template | string | required | Template name. |
locale | string | optional | Locale for the template. |
client | string | optional | SMTP client configuration id. |
data | object | optional | Variables for the template. |
references | array | optional | List of references. |
schedule | string | optional | Schedule date and time for sending. |
to | MailingRecipient | required | Destination of the email. Can be direct email, list ID, or topic ID. direct/list/topic. |
Response
object — Returns result and number of e-mails send
Sample request
{
"template": "welcome",
"locale": "en_US",
"to": {
"direct": "customer@example.com"
},
"data": {
"name": "Alex"
}
}to accepts a direct address (or a list of them), a mailing list id or a topic id. data fills the template's variables.