← All migration guides

Migration guide / Transactional email

Migrate from SendGrid to SMTPfast.

Flatten personalizations into one email per recipient, map the event names, and move your suppression lists.

SendGrid's v3 mail/send wraps recipients in personalizations and the body in a content array. SMTPfast takes one flat email per request, or up to 100 in a batch. Most of the work is in three places: the send payload, the event webhook handler, and the bounce, spam report and unsubscribe lists you export from SendGrid.

SendGrid details checked against its own docs on 2026-12-02. Still deciding? SMTPfast vs SendGrid.

Move to SMTPfast if

  • Most of your mail is product mail sent from code, and you want logs, webhooks and suppressions you can debug.
  • You want an Idempotency-Key on sends, so a retry after a timeout does not send twice.
  • You want scheduling up to 30 days ahead (SendGrid: 72 hours).

Stay on SendGrid if

  • Your templates use Handlebars logic (#if, #each) that you do not want to move into your own code.
  • You use Marketing Campaigns automations, dynamic segments or a dedicated IP.
  • You send one request with up to 1,000 personalizations and want to keep that shape.

The code change.

Before: SendGrid

curl -X POST https://api.sendgrid.com/v3/mail/send \
  -H "Authorization: Bearer $SENDGRID_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "personalizations": [{ "to": [{ "email": "[email protected]" }] }],
    "from": { "email": "[email protected]", "name": "Acme" },
    "subject": "Your receipt",
    "content": [{ "type": "text/html", "value": "<p>Thanks for your order.</p>" }],
    "custom_args": { "order_id": "1041" }
  }'

After: SMTPfast

curl -X POST https://smtpfa.st/api/v1/emails \
  -H "Authorization: Bearer $SMTPFAST_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "from": "Acme <[email protected]>",
    "to": [
      "[email protected]"
    ],
    "subject": "Your receipt",
    "html": "<p>Thanks for your order.</p>",
    "tags": [
      {
        "name": "order_id",
        "value": "1041"
      }
    ],
    "category": "transactional"
  }'

What maps to what.

Sending
SendGridSMTPfast
POST /v3/mail/sendPOST /v1/emails, or POST /v1/emails/batch for up to 100
personalizations[].to / cc / bccto, cc, bccStrings or arrays of strings, "Name <email>" allowed. One personalization becomes one email.
from { email, name }from: "Name <email>"
reply_to / reply_to_listreply_to (string or up to 50)
content [{ type, value }]html, textLeave out text and SMTPfast generates it from the HTML.
attachments [{ content, filename, type, disposition, content_id }]attachments [{ content, filename, content_type, content_id }]A content_id makes the part inline. Up to 10 files, 10 MB each, 25 MB of attachments per email.
custom_args, categoriestags [{ name, value }]Up to 50 per email. Stored with the email, returned by GET /v1/emails/:id and searchable in Logs. Webhook events do not carry them: look the email up by email_id.
send_at (unix time, up to 72 hours)scheduled_at (ISO 8601, up to 30 days)
asm.group_id (unsubscribe groups)category and topicsA transactional email has no unsubscribe link. For broadcasts, topics let people opt out of one kind of email.
No idempotency keyIdempotency-Key header
SMTP
SendGridSMTPfast
Host smtp.sendgrid.netHost smtp.smtpfa.st
Ports 25, 587, 2525 (STARTTLS), 465 (SSL)Ports 587 and 2525, STARTTLSThere is no implicit TLS port (465). Use 587, or 2525 where 587 is blocked.
Username the string apikeyUsername smtpfast
Password API keyAn SMTPfast API key with the email:send scope
Event Webhook
SendGridSMTPfast
processedemail.sent
deliveredemail.delivered
deferredemail.delivery_delayedNot the same event: it fires when SMTPfast retries handing the email to its provider, not for delays at the receiving server, which SMTPfast does not report.
bounce (type bounce or blocked)email.bouncedbounce_type is Permanent, Transient or Undetermined.
droppedemail.suppressed or email.failed
spamreportemail.complained
open, clickemail.opened, email.clicked
unsubscribe, group_unsubscribeemail.unsubscribed
group_resubscribeNo equivalent
A JSON array of events, signed with ECDSAOne event per request, signed with HMAC-SHA256 (X-SMTPfast-Signature)
Templates and suppressions
SendGridSMTPfast
Dynamic templates (Handlebars), template_id d-...Templates with {{{VARIABLE}}}, template: { id, variables }Variables are strings or numbers. No #if or #each.
dynamic_template_datatemplate.variables
Bounces, Spam Reports, Invalid Emails, BlocksSuppressions, scope allReview blocks before you import them: a receiving server can refuse mail for reasons other than the address.
Global Unsubscribes, Group UnsubscribesSuppressions, scope marketingThey stop marketing email and let transactional mail through.
Marketing Campaigns contactsContactsPOST /v1/contacts with { contacts: [...] }, 500 per call.

Step by step.

  1. 1

    Add and verify your sending domain

    Add the domain in the dashboard (or with POST /v1/domains) and publish the records it shows: three DKIM CNAMEs, an MX and an SPF TXT record for the bounce subdomain (MAIL FROM), and include:amazonses.com in the SPF record of the domain. A domain has one SPF record, so add the include to the one you have. The DKIM and bounce records have their own names, so they sit next to your current provider's records and both can send while you switch. Keep your DMARC record if you have one. On Cloudflare DNS, SMTPfast can add the records for you.

  2. 2

    Create an API key

    Create a key with the email:send scope for the app that sends. Give webhook and contact jobs their own keys with only the scopes they need (webhook:write, contact:write).

  3. 3

    Rewrite the send call

    Turn each personalization into one email: to, cc and bcc move to the top level, content becomes html and text, custom_args become tags. If one request sent many personalizations, send them as one POST /v1/emails/batch of up to 100 items. Add category: "transactional" to mail people need; SMTPfast treats an email without it as marketing.

  4. 4

    Move the templates you still need

    Create each dynamic template as an SMTPfast template, with {{name}} written as {{{NAME}}}. Logic such as {{#each items}} has no equivalent, and variable values are escaped, so you cannot pass HTML into a template. Render those emails fully in your code and send html instead.

  5. 5

    Export and import suppressions

    In SendGrid, download the CSVs for bounces, spam reports and global unsubscribes (Export CSV, Download as CSV), or page through GET /v3/suppression/bounces and the other lists. Add bounces and spam reports with POST /v1/suppressions/batch/add, 100 per call. Add unsubscribes one at a time with scope marketing, so they still get receipts.

    # Unsubscribed from marketing: block marketing only
    curl -X POST https://smtpfa.st/api/v1/suppressions \
      -H "Authorization: Bearer $SMTPFAST_API_KEY" \
      -H "Content-Type: application/json" \
      -d '{ "email": "[email protected]", "scope": "marketing" }'
  6. 6

    Point your webhooks at the new events

    Create a webhook for email.delivered, email.bounced, email.complained and the other events you handled and check the X-SMTPfast-Signature header: a hex HMAC-SHA256 of the raw body with the webhook's signing secret. Every event body is { type, timestamp, data }. Failed deliveries are retried 4 more times over about 36 minutes, and you can replay any of them from the delivery log.

    import crypto from "node:crypto";
    
    // rawBody: the request body exactly as received, before JSON.parse
    function isFromSmtpfast(rawBody: string, signature: string, secret: string) {
      const expected = crypto.createHmac("sha256", secret).update(rawBody).digest();
      const given = Buffer.from(signature, "hex");
      return given.length === expected.length && crypto.timingSafeEqual(given, expected);
    }
  7. 7

    Send a test and move traffic in stages

    Send to an address you own and check the email in Logs, then in the received message headers (DKIM and SPF pass, aligned with your From domain). Move one kind of mail first, such as password resets, and watch bounces and complaints for a few days before you move the rest. A new account has warm-up limits, so a large list should not move in one day.

What SMTPfast does not have

Check these before you move. If one is a blocker, stay where you are.

  • Templates have plain variables only: no Handlebars conditions, loops or partials.
  • No equivalent of 1,000 personalizations in one call. Batch is 100 emails per request.
  • No unsubscribe groups with a preference page for transactional mail. Topics cover broadcasts.
  • No dedicated IPs, IP pools or subusers. Teams with roles exist on paid plans.
  • No marketing automations or dynamic segments yet. Segments are manual lists.
  • No implicit TLS SMTP port (465). Webhooks need a paid plan.

Frequently asked questions.

How do SendGrid categories and custom_args move over?

Both become tags, an array of name and value pairs. They are stored with the email: GET /v1/emails/:id returns them and you can filter Logs by them. Webhook events carry the email_id, not the tags, so look up the email when a handler needs them.

What happens to my unsubscribe groups?

Mail in an unsubscribe group was usually marketing. Send it with category marketing (the default) and SMTPfast adds a one-click unsubscribe link. Import the group's unsubscribes as marketing suppressions. Receipts and password resets go out as transactional and are not blocked by a marketing opt-out.

Can I run SendGrid and SMTPfast side by side?

Yes. The DKIM records and the bounce subdomain have their own names, and one SPF record can include both senders. Move one kind of mail at a time and keep SendGrid until its last webhook arrives.

Try it on the free plan

Verify a domain, send a test and check it in Logs before you move any traffic. Webhooks and inbound mail need a paid plan.