Skip to content

Change the email without a deploy.

Email for product teams. Pass the data, publish a version, and roll back when you need to. The send call stays put.

One template, personal by design

The layout stays.
The details are theirs.

A receipt has the same job every time. Pass a name, an order, and a total to make it personal.

Recipient
order-receipt.tsxTemplate · render
render: ({ name, orderId, total }) => ({
  subject: `Your receipt for order ${orderId}`,
  body: (
    <div>
      <p>Hi {name},</p>
      <h1>Thanks for your order.</h1>
      <p>Order {orderId}</p>
      <p>Total: {total}</p>
      <p>Questions? Reply to this email.</p>
    </div>
  ),
})
send.ts · recipient data
await samva.email.send({
  "to": "maya@example.com",
  "templateSlug": "order-receipt",
  "templateData": {
    "name": "Maya",
    "orderId": "A-1042",
    "total": "$48.00"
  }
});
To: maya@example.comPreview

Your receipt for order A-1042

Hi Maya,

Thanks for
your order.

Order A-1042

Total: $48.00

Questions? Reply to this email.

#01VERSIONS

Edit, publish, and roll back.

  • Save your changes in version history while the published email keeps sending
  • Publish a saved version to use it for sends that reference the current publication
  • Restore saved source into a draft, then preview and publish it
ALL ABOUT VERSIONS
order-update · versions
Draftdraft
Publication 3published
Publication 2previous

Restore saved source into a draft, preview it, then publish when it is ready.

#02RENDERING

Pass the data. Get the finished email.

  • Reference a template by id or slug instead of inline subject and HTML
  • Pass data by name and Samva renders the published version server-side
  • Preview and validate a template's content before you publish it
ALL ABOUT RENDERING
samva.email.send(…)
templateSlug: "order-update"
templateData: { orderId: "A-1042" }

Samva renders the published template with the data you pass, sends the email, and returns a message id.

#03REUSE

One template, every send that needs it.

  • Create a template once and send from it by reference wherever the message repeats
  • Content lives in one place, so a copy fix ships without a deploy
  • Restore a saved version into a new draft while the published version keeps sending
ALL ABOUT REUSE
templateSlug: "order-update"
checkout service → send
fulfillment service → send
support tool → send

Every service that triggers this message references the same template by slug.

( SEND, RECEIVE, LAND )

More from the email API.

Common questions.

What is a template in Samva?

A reusable email template with saved source and published versions. Reference it by templateId or templateSlug and pass templateData instead of inline subject and HTML.

How do I change what a template sends without touching code?

Edit, save, and publish a new version. Sends using the current publication pick it up through the same template reference. Sends pinned to an exact publication keep using that publication.

Can I undo a template change?

Yes. Restore saved source into a draft, preview it, then publish it. Restoring a draft does not change the published email.

How does data get into a rendered template?

Pass templateData on the send call with the values the template expects, keyed by name. Samva renders the published version server-side and sends the result, so the layout and the data stay separate.

Can I check a template before it goes out?

Yes. Render and preview a template's output before publishing, so you see the finished email before it reaches a version that sends.

Free to start

Publish the first template today.

Sign up and send your first email from a version you published.

Related Resources