Skip to content
  • api
  • sdk
  • cli

Add your own headers to any email you send

Pass a headers map on a send and Samva copies it onto the outgoing email, from the API, the SDK, or the CLI. Names Samva owns are rejected.

An email can now carry headers of your own, such as a tag your mail system reads back later. Add a headers map to a send and Samva copies it onto the message.

What you need to do. Nothing, unless you want a header. One email takes up to 11, and a name Samva writes itself, like From, is rejected with a 422 that names it. In the CLI, repeat --header 'Name: Value'.

await samva.email.send({
  to: "ada@example.com",
  subject: "Your sign-in code",
  text: "Your code is 123456.",
  headers: { "OTP-Token": "123456" },
});

Links

Related

All changelog entries