Account and security · Any app

Maqetin sends the code that signs someone in.

A one-time code for signing in or confirming an action. Your server makes one call to the send API when someone asks for it.

The email.

A sample to adapt: change the names, the product and the button to yours.

FromHarbour Money <hello@mail.harbourmoney.co.uk>SubjectYour sign-in code: 482 913PreviewIt expires in 10 minutes.

Enter this code to sign in to Harbour Money: 482 913.

It expires in 10 minutes. Harbour Money never asks for it by phone or chat.

Harbour Money, London

Sample workspace: Harbour Money, a digital bank in London.

How it is sent.

Your server sends it with one call to the send API, when someone asks to sign in. The call names the template, the person and the data the email prints.

await mq.messages.send({
  channel: 'email',
  templateId: 'tpl_sign_in_code',
  to: { userId: 'cust_90314' },
  from: 'Harbour Money <hello@mail.harbourmoney.co.uk>',
  data: { code: '482913', expires_in_minutes: 10 },
  idempotencyKey: 'sign-in-cust_90314-0918',
})

Events to send.

No event starts this email. Your server makes the call when someone asks for a code.

Check before you send.

  • Use a sending address on a verified domain. A message from an address on a domain that is not verified for the workspace is not sent.
  • Put the code in the subject. Say in the preheader when it expires, and that you never ask for it by phone or chat.
  • Reuse the Idempotency-Key on a retry. A retry after an error then never sends a second code.

More account and security templates.

Send a code from your own domain.