Skip to main content

Introduction

The Resend integration sends a transactional email through Resend when a Dodo Payments event occurs. Use it to confirm payments, welcome new subscribers, and tell customers when a payment fails, from your own sending domain.
This integration requires a Resend API key with Sending access and a sending domain verified in Resend. You also need access to Developer → Webhooks in the Dodo Payments dashboard.

Getting Started

1

Open the Webhook Section

In the Dodo Payments dashboard, go to Developer → Webhooks and click Add endpoint.
Add endpoint dialog with Resend selected in the Integration dropdown and the How to connect Resend steps
2

Select Resend

In Integration, select Resend. The dashboard fills in the Endpoint URL and the transformation code for Resend, and the How to connect Resend panel shows the setup steps.
3

Enter API Key

In Resend, open API Keys, click Create API Key, and give the key Sending access. Resend shows the key, which starts with re_, only once. Paste it into API key. Dodo Payments sends it as a bearer token in the Authorization header of every request to Resend.
4

Select Events

In Subscribed events, select only the events your transformation handles. An event that the transformation leaves unchanged reaches Resend in the Dodo Payments format, and Resend rejects it.
5

Configure Transformation

Under Transformation code, edit the handler so each subscribed event becomes a Resend email. Start from the examples.
6

Test & Create

Under Test this code, select an event type and click Simulate to preview the request to Resend. Then click Create endpoint.
7

Done

Dodo Payments now sends an email through Resend for each subscribed event. To see each delivery and Resend’s response, open the Logs tab in Developer → Webhooks.

Transformation Code Examples

Each handler sets webhook.url to Resend’s send-email endpoint and replaces webhook.payload with the email. Dodo Payments amounts are in the smallest currency unit, so the examples divide by 100 and show the currency code. For zero-decimal currencies such as JPY and KRW, use the amount as is.

Payment Confirmation Email

Send a receipt when a payment succeeds (payment.succeeded):
payment_confirmation.js

Subscription Welcome Email

Welcome a customer when a subscription becomes active (subscription.active):
subscription_welcome.js

Payment Failure Notification

Ask the customer to update their payment method when a payment fails (payment.failed):
payment_failure.js

Tips

  • Send from a domain you’ve verified in Resend, which improves deliverability.
  • Include both an html and a text version of each email.
  • Personalize content with customer data from the payload, such as customer.name.
  • Write subject lines that state the result or the action needed.
  • Include an unsubscribe link in any email that contains marketing content.
  • Preview each template with Simulate before you create the endpoint.
  • To skip an event in code, set webhook.cancel = true before you return the webhook. The logs record a skipped delivery as successful.

Troubleshooting

  • Check that the API key is correct, active, and has Sending access. To replace it, edit the endpoint and paste a new key in API key.
  • Check that the sender domain is verified in Resend.
  • Check that the recipient email addresses are valid.
  • Check Resend’s sending limits and quotas for your plan.
  • Open the Logs tab in Developer → Webhooks and read Resend’s response to the failed delivery.
  • Check that the payload matches Resend’s send-email format. Resend requires from, to, and subject.
  • Check that every event your code handles sets all the required fields.
  • Check that the html value is well-formed HTML.
  • Check that the from address uses a domain verified in Resend.
Last modified on September 26, 2026