Before you start
The five minutes start once these three are true. The first two depend on your provider and your DNS, not on Lekalao: they can take longer.1
A mailer that sends
Lekalao sends nothing itself: it hands each e-mail to a provider. Settings → Mailers lists the ones your team can use: your own, and the one the service shares with every team when it offers one. One of them must be chosen for Transactional e-mails, or be the Default mailer.If the list is empty, Add a mailer (SES, Postmark, Mailgun, SendGrid, Brevo, Resend or SMTP), then Send a test e-mail: it proves the credentials. See Mailers.
2
A sender on a verified domain
On Lekalao’s service, the sender address must be on a domain your team added and verified in Deliverability. Otherwise the call is refused (
422), and the message names the domain. DNS records can take from minutes to hours to be seen: do this first. See Sending domains.On an installation of your own, this applies only when its administrator asks for it.3
The right role
Creating a token takes the editor or owner role in the team.
1. Create a token
Settings → API tokens → New token. Give it a name (“Online shop”), and under What it may do, choose Read and write: sending is a write, following the e-mail is a read. Switch on Test key to try without sending. Create, then copy the token: it is not shown again.2. Write the template
Transactional → Transactional templates → New template. Name itorder-confirmation, keep the HTML editor, Create. Then, on its page:
-
Subject:
Order {{ order.number }} confirmed -
the content:
- Sender address: an address on your verified domain. Empty, the team’s from Settings → General is used.
3. Send it
Put your own address into, so that you see the e-mail arrive. An address that does not exist bounces, and goes on your suppression list.
https://your-domain/api/v1/transactional-mails/send.
The Idempotency-Key makes the call safe to repeat: sent twice, it sends one e-mail. Give each e-mail its own key, such as the order number and the action.
4. Read the answer
The answer comes as soon as Lekalao has written the e-mail down:202, with status at pending.
202 Accepted
pending is not a problem: the e-mail leaves from a queue a moment later. Keep its id.
5. See it leave
Read the e-mail by itsid:
When the provider fails, Lekalao tries again for up to six hours before it gives up. In your application, let Lekalao tell you rather than ask: the
transactional.* webhooks say when the e-mail is sent, delivered, bounced or failed.
The e-mail is also in Transactional, the log, with its content and its opens. See The log.
When it does not arrive
Next
Everything about sending
Without a template, attachments, languages, retries and resends.
Webhooks
Sent, delivered, bounced, opened: each e-mail’s life, signed, in your application.
From Laravel
Keep
Mail::to()->send(), and send through Lekalao.Errors
Every code, and when to try again.