Send a transactional e-mail
Sends from a transactional template (template) or from HTML you supply (html). The e-mail is logged, followed (opens and clicks when the template asks for it) and counted against the allowance: each recipient counts, copies included. Without to, the template’s default recipients are used; addresses on the suppression list are left out.
At most 50 recipients per e-mail, to, cc and bcc together (too_many_recipients). mailer names one of the team’s providers or one the platform offers, never another team’s.
The call is answered as soon as the e-mail is logged, and the e-mail leaves from a queue: the answer is usually 202 with status: pending. Follow it with the transactional.* webhooks, or read it again with GET /v1/transactional-mails/{mail} until status is sent or failed. When the provider fails, Lekalao tries again after 5 s, 30 s, 2 min, 10 min and 30 min, and gives up after the sixth failure or six hours after the call (provider_error). An e-mail still pending after 7 hours is declared failed with failure_code: lost.
A refusal is an error with the logged e-mail under data: 422 recipients_suppressed (every address is suppressed), 429 monthly_quota_exceeded (the allowance is used up), 502 only when the provider or the queue failed.
With a test key, nothing leaves: see Test keys.
Authorizations
An API token. The "read" ability: GET routes only. "read + write": every route.
Headers
Replay a write safely: the same key gives back the first answer for 24 hours (header Idempotent-Replay: true). Read on POST, PUT and PATCH; DELETE ignores it. 255 characters at most.
255Body
The name of one of the team's transactional templates.
The HTML body, when no template is given.
Replaces the template's subject.
50 addresses at most, cc and bcc included.
505050They fill the template: {{ order.number }}, {% for %} loops…
Which language version of the template to send (fr, pt-BR…). Without a value, the base version.
The name of one of the team's providers, or of one the platform offers, to force that one. Any other name is refused.
10Response
The e-mail had already been handed to the provider when the answer left (status: sent).