Transactional email templates without a deploy
To change transactional email wording without a deploy, keep the words in templates outside your codebase and have your code send by template name. With SagePigeon's Email API, your support or product lead edits and publishes a template in the dashboard, and your code makes one call with the template's name, the recipient and a few variables. Every publish is a version, so a bad edit can be undone by restoring the one before, and a send can pin a version when its words must not change.
Why the words should leave the codebase
Receipts, booking confirmations and password reset emails start life as strings in the code. That is fine until someone outside engineering needs to change one. Then a one-word fix becomes a ticket, a pull request, a review and a release, and the person who asked for it waits for the next release to see it live.
The opposite mistake is a drag-and-drop builder that lets anyone change anything, including the layout your code depends on. SagePigeon sits between the two. Templates are the words and HTML of an email with variables in them, edited in the dashboard, and the API refuses to send a template that has never been published.
What a send looks like
POST /api/v1/emails
x-api-key: fsk_live_…
content-type: application/json
{
"template": "Order receipt",
"to": "customer@example.com",
"variables": {
"customer": { "name": "Jo" },
"order": { "number": "8812", "total": "$140.00" }
},
"idempotencyKey": "order-8812"
}
→ 202 { "id": "…", "status": "sent",
"to": ["customer@example.com"], "suppressed": [],
"remainingToday": 1999 }template is the template's name (or its id); the docs on sending with a template list every field. variables fills the placeholders in the template, so {{customer.name}} becomes "Jo". idempotencyKey makes retries safe: send the same key again and you get the original message back with "deduplicated": true, and nobody gets a second receipt.
Set it up
You need a Pro or Scale workspace, and an owner or admin for the first three steps.
- Choose a sender. For your own from address, verify a sending domain. You can start with the configured shared sender by omitting
fromwhen no domain is selected. To add your own domain, go to Settings → Sending, enter your domain under Add a domain and press Add domain. Add each DNS record shown where your domain's DNS is managed, using Copy name and Copy value, then press Check DNS. A new record can take an hour to be seen. - Write the template. Open Templates under Sending in the sidebar and press New template. Give it a Name your code will quote, such as "Order receipt", a Subject (which may carry variables, such as "Your receipt for order {{order.number}}") and a Body (HTML).
- Publish it. With a subject and body filled in, the button reads Create and publish, and the template goes live as version 1. If you only gave it a name, open it later and press Publish; until then any send that quotes it is refused.
- Create a key. Open Sending → API keys, press Create a key, describe it under What it is for, and tick Allow writes, because sending is a write. Copy the key: it is shown once. If an agency client should only send its own mail, tick Limit it to one client. The authentication docs cover the header and what each kind of key may do.
- Send. The template page has a Variables section listing every placeholder it found in the words. Type sample values and the preview updates, along with a ready-made call you can take with Copy the call.
Editing without breaking anything
From then on, the person who owns the wording opens the template, changes it, previews it against the sample values and presses Publish a new version. The next send uses it. No code changed and nothing was deployed. Creating and publishing templates needs the admin role, so give that role to whoever owns the words.
Two features keep that safe.
Versions and restore. Every publish is kept in the template's history with who published it and when. Restore on an older version publishes those words again as a new version that records where it came from. Renaming a template does not create a version.
Pinning. Add "templateVersion": 3 to a send and it uses version 3 whatever is published later. Pin the emails where wording has legal or contractual weight, such as a cancellation confirmation, and leave the rest on the newest version.
One thing to watch. The variable list is read from the words when the template is published, and a send that leaves a variable out is not refused; the placeholder renders as empty. If an editor adds {{order.deliveryDate}} and your code never sends it, the email says "Arriving on ." Check the Variables list after each publish.
The limits, and why they are there
The Email API is built for transactional mail, so it has limits a newsletter tool would not:
- 10 recipients per request. Anything larger is a mailing, and this API is not built for mailings.
- A daily cap. Pro sends up to 2,000 a day and Scale up to 20,000, reset at midnight UTC.
- A warm-up. A new workspace starts at 50 a day, then 200 after three days and 1,000 after a week, and reaches its plan's cap two weeks in. Mail providers trust a new sender that grows steadily.
- Burst limits. 60 a minute and 1,000 an hour.
- Sender identity. A custom
frommust use your verified domain. If you omitfromand have no domain configured, the deployment’s shared sender is used with your sender name. A client never borrows the workspace’s domain. - Reputation. If 4% of your mail in the last 30 days bounced (once 50 have been sent), or 0.1% was reported as spam, sending pauses. SagePigeon emails a warning at half those rates.
Addresses that bounce or complain go on your suppression list and are not sent to again. The response lists anyone dropped in suppressed, so your code knows. A send where every recipient is suppressed is refused with 422 suppressed.
GET /api/v1/emails/usage tells your code what is left today, and every error comes back as { "error": code, "message": why }. The errors table in the docs lists them all.
One log for form mail and API mail
Every message the API sends lands in the same Email log as your form notifications, with its delivery, bounce and spam-report events as they arrive. When a customer says the receipt never came, support can look it up by address without asking engineering to read logs.
To see whether someone replied to a booking confirmation, send with "trackReplies": true and a replyTo. Replies are kept on the message and passed on to your replyTo address. The reply tracking docs cover the details.
What it costs
The Email API is on Pro ($49 a month) and Scale ($149 a month). Both include the form features as well, so one workspace covers your contact forms and your receipts. See pricing.
Questions people ask
Can I use the Email API without any forms?
Yes, on Pro and Scale. Choose a sender, create an API key that can write, publish a template and post to /api/v1/emails. Forms are not involved.
What happens if a template change breaks an email?
Every publish is a version. Restore an older version from the template's history, and it is published again as a new version. Sends that pin a version with templateVersion are not affected by new publishes at all.
Is the Email API on the Free plan?
No. It is on Pro, with up to 2,000 emails a day, and Scale, with up to 20,000. New workspaces start lower and reach that cap over two weeks.
What if a variable is missing from the request?
The send is not refused. The missing variable renders as empty, so check the variable list on the template page against what your code sends.