Skip to main content

Introduction

Send transactional emails automatically when payment and subscription events occur. Payment confirmations, subscription updates, and failure notifications go out through Keplars with no middleware server: Dodo Payments calls the Keplars API directly, using a JavaScript transformation handler.
This integration authenticates with your Keplars API key. Find it in the Keplars dashboard under Settings → API Keys, and verify a sender domain or address under Domains.

Getting Started

1

Open the Webhook Section

In the Dodo Payments dashboard, go to Developer → Webhooks and click Add endpoint.
2

Select Keplars

In Integration, select Keplars. The template fills in the Keplars API URL and the transformation code.
Add endpoint dialog with Keplars selected in the Integration dropdown
3

Enter API Key

Paste your Keplars API key into API key. Dodo Payments sends it as a Bearer token on every request. Under Subscribed events, select the events that should send an email.
Keplars endpoint URL filled in, the API key field, and the Subscribed events list
4

Configure Transformation

In Transformation code, edit the code to format emails for Keplars. Replace the placeholder template IDs with your own.
5

Test & Create

Under Test this code, select an event type and click Simulate to run the transformation against a sample payload. Then click Create endpoint to start sending emails.
6

Done

Dodo Payments events now send transactional emails through Keplars.

Transformation Code Examples

Each handler sets webhook.url to the Keplars high-priority send endpoint and rewrites webhook.payload into a Keplars request. Dodo Payments adds the API key as a Bearer token. Replace your-keplars-*-template-id with your template IDs. The Keplars send API has no from field, so Keplars sends each email from a sender you set up in the Keplars dashboard.
to must be an array, even for a single recipient. When you use template_id, don’t also send subject or body, because the template supplies them.

Payment Confirmation Email

payment_succeeded.js

Payment Failure Notification

payment_failed.js

Subscription Welcome Email

subscription_active.js

Subscription Cancellation Email

subscription_cancelled.js

Tips

  • Send from a verified domain or address to improve deliverability.
  • Create one Keplars template per event type, so each email stays on-brand and on-message.
  • Personalize each email by passing customer data, such as the name, amount, and payment ID, in params.
  • Test in sandbox mode first. Keplars captures sandbox sends in its Test Inbox instead of delivering them.

Troubleshooting

  • Check that your API key is correct and active in Keplars under Settings → API Keys.
  • Check that your sender domain or address is verified.
  • In the Dodo Payments dashboard, open the message in the Logs tab of Developer → Webhooks. Each delivery attempt shows the raw error response from Keplars.
  • The template_id in your handler must match an active template in your Keplars account. Check the ID, and check that the template is active, in the Keplars dashboard.
  • Each handler checks webhook.eventType and returns the webhook unchanged if the event doesn’t match. Check that the endpoint’s Subscribed events include only the events you want.
Last modified on September 30, 2026