inmake DOCS
Docs / API / Mailing

Mailing

Send a store e-mail template.

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

NameTypeRequiredDescription
storestringrequiredPreferred in header, but store ID can be also used in request body.
templatestringrequiredTemplate name.
localestringoptionalLocale for the template.
clientstringoptionalSMTP client configuration id.
dataobjectoptionalVariables for the template.
referencesarrayoptionalList of references.
schedulestringoptionalSchedule date and time for sending.
toMailingRecipientrequiredDestination 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.