How to Build Email Notifications with Resend
Send beautiful transactional emails from your workflows using Resend.
What This Integration Does
Transactional emails - order confirmations, password resets, alert digests, "your export is ready" pings - are the connective tissue between your app and your users. Resend is a developer-friendly email API with great deliverability, and Spojit's resend connector exposes its full sending surface area through a connector node. This tutorial sets up a reusable notification pattern: a single workflow you call from anywhere in your stack to send a templated email, with batching, retries, and observability baked in.
The workflow can run two ways. As a subworkflow, other workflows invoke it with a template name and merge data. As a webhook trigger, your app posts notification events directly to it. Either way it picks the right template, renders it with the merge data, sends via resend, and logs the send id for traceability.
Prerequisites
- A Resend account and a verified sending domain (DKIM, SPF, and DMARC set up).
- A Resend connection in Spojit using your API key.
- A set of email templates (HTML or markdown). A handful of named templates beats one giant if/else.
- (Optional) a tracking store like mongodb for logging sends and bounces.
Step 1: Choose Trigger - Webhook or Subworkflow
Drop a Trigger node onto the canvas. Pick Webhook if other systems will POST notification events directly. Pick the subworkflow entry point if you want other Spojit workflows to call this one. Either way the input payload should carry template (template name), to (recipient), and data (merge variables).
Step 2: Transform - Render the Template
Add a Transform node that selects the right template based on {{ trigger.template }} and produces the final subject and html. For richer templating, store templates in a Knowledge collection or in mongodb and look them up here. Either way the output is a fully-rendered email body, with {{ data.firstName }} style placeholders already substituted.
Step 3: Send the Email via Resend
Add a Connector node pointing at the resend connector and pick the send-email tool. Configure:
from:notifications@yourcompany.com(must be on your verified domain)to:{{ trigger.to }}subject:{{ rendered.subject }}html:{{ rendered.html }}tags:[{ "name": "template", "value": "{{ trigger.template }}" }]for analytics in the Resend dashboard
Resend returns an id for every accepted send - capture it for the log.
Step 4: Batch Sends When Possible
For digest-style notifications going to many recipients at once, swap send-email for send-batch-emails. It accepts an array of message objects and is significantly faster than looping single sends. Wrap a Transform node before it to build the array, capped at Resend's per-call batch limit.
Step 5: Log the Send
Add a Connector node pointing at mongodb with insert-documents (or your store of choice) and write { resendId, template, to, sentAt, status: "sent" }. This log is what lets support answer "did the customer get the email?" without logging in to Resend.
Step 6: Handle Bounces and Failures
Add a Condition node after the send that checks the Resend response for errors. On failure, call slack send-message into your alerts channel with the template name, recipient, and error message. Spojit's per-node retry handles transient API errors automatically. For longer-term bounce handling, configure a Resend webhook back into Spojit that updates your tracking store and suppresses future sends to bouncing addresses.
Tips
- Verify your sending domain end-to-end before going live. Sending from an unverified domain tanks deliverability instantly.
- Include both an HTML and a plain-text version when you can. Some clients (and most filtering pipelines) prefer it.
- Tag every send. Resend's tag-based analytics are how you'll spot a misbehaving template before customers complain.
Common Pitfalls
- Hardcoding "from" addresses across workflows. Put it in one place so a domain change is a one-line edit.
- Forgetting unsubscribe links for marketing emails. Transactional emails are exempt, but the line is blurry - when in doubt, include one.
- Sending one-at-a-time in a loop when you have hundreds of recipients. Use
send-batch-emailsinstead.
Testing
Send to a personal address with a known template. Open the message in Gmail and Outlook - layout breaks differently in each. Then test the failure branch by deliberately sending to an invalid address and confirm the Slack alert fires. Once those two pass, hook your real callers up.