# Introduction URL: https://eusend.dev/docs EU-native transactional and marketing email API. Your email data never leaves the European Union — built with GDPR in mind. eusend is a transactional and marketing email API built on EU infrastructure, from European providers. Your email data never leaves the European Union — built with GDPR in mind. The supporting services we use around the product are listed on our [sub-processors page](https://eusend.dev/legal/subprocessors). - **REST API** — Simple HTTP API. One POST to send an email. - **EU Infrastructure** — All email data in EU data centres. Germany & Finland. - **React Templates** — Design emails in React, send server-rendered HTML. Coming from another provider? [Migrating from Resend takes minutes](/migrate) — the SDK mirrors Resend's field-for-field. # Audiences URL: https://eusend.dev/docs/audiences Named contact lists used as targets for broadcasts. Create multiple audiences to segment your contacts. Audiences are named contact lists used as targets for broadcasts. Create multiple audiences to segment your contacts. `POST /audiences` | Parameter | Type | Description | | --- | --- | --- | | `name` (required) | `string` | Display name for the audience (e.g. "Newsletter subscribers"). | ```bash title="create audience" curl -X POST https://api.eusend.dev/audiences \ -H "Authorization: Bearer eu_live_xxxxxxxxxxxx" \ -H "Content-Type: application/json" \ -d '{ "name": "Newsletter subscribers" }' ``` ```json title="response — 201 Created" { "id": "550e8400-e29b-41d4-a716-446655440000", "name": "Newsletter subscribers", "createdAt": "2026-05-20T10:00:00.000Z" } ``` The rest of the audience surface: `GET /audiences` List audiences. `GET /audiences/:id` Get one audience with its contact count. `PATCH /audiences/:id` Rename an audience — send `{ "name": "..." }`. `DELETE /audiences/:id` Delete an audience. # Contacts URL: https://eusend.dev/docs/audiences/contacts Add and manage individual contacts within an audience. Contacts can also be imported via CSV in the dashboard. Add and manage individual contacts within an audience. Contacts can also be imported via CSV in the dashboard. `POST /audiences/:id/contacts` Add a single contact to an audience. If the email already exists in the audience the record is updated (upsert). | Parameter | Type | Description | | --- | --- | --- | | `email` (required) | `string` | Contact email address. | | `first_name` | `string` | Contact first name. | | `last_name` | `string` | Contact last name. | | `properties` | `object` | Custom properties, usable as {{key}} in a broadcast body. Replaces the stored properties — see below. | ## Custom properties [#custom-properties] Anything you store on a contact under `properties` becomes a variable in a broadcast, so a contact written with `{ "plan": "pro" }` renders `{{plan}}` as `pro`. Combined with the fallback syntax, `Hi {{first_name|there}}, you are on the {{plan|free}} plan` covers the contacts that are missing the value. You do not have to declare a property before setting one — an unknown key registers itself as a string. Declaring it in [Contact properties](/docs/audiences/properties) is what gives it a type and a fallback value that every broadcast picks up. The rules are deliberately narrow, because every value ends up substituted into an email: * **Values are strings.** A number or a date would need a formatting and locale decision that a merge tag has nowhere to express, so make it yourself and send the result. A property declared `number` is checked on write, but still renders exactly as sent. * **Names are lowercase** letters, digits and underscores, starting with a letter, at most 40 characters. Up to 20 properties per contact, each value at most 500 characters. * **`email`, `name`, `first_name`, `last_name` and `full_name` are built in** and are rejected as property names. `{{email}}` always resolves to the contact's real address. > [!WARNING] > **`POST` replaces, `PATCH` replaces, an import merges.** Sending `properties` to `POST > /audiences/:id/contacts` or `PATCH /audiences/:id/contacts/:contactId` replaces the whole object, > which is what lets you remove a key. The batch endpoint merges instead, so a CSV carrying only > `plan` will not drop a `company` an earlier import set. ```bash title="a contact with custom properties" curl -X POST https://api.eusend.dev/audiences/550e8400-e29b-41d4-a716-446655440000/contacts \ -H "Authorization: Bearer eu_live_xxxxxxxxxxxx" \ -H "Content-Type: application/json" \ -d '{ "email": "alice@example.com", "first_name": "Alice", "properties": { "plan": "pro", "company": "Acme", "renews_on": "3 March 2026" } }' ``` `POST /audiences/:id/contacts/batch` Upsert up to 1,000 contacts at once. Existing contacts (matched by email) are updated; new ones are inserted. This is what the dashboard's CSV import calls. | Parameter | Type | Description | | --- | --- | --- | | `contacts` (required) | `array` | Array of contact objects. Each has email (required), plus optional first_name, last_name, properties, unsubscribed, and created_at. | | `contacts[].unsubscribed` | `boolean` | Marks the contact opted out, so a list migrated from another provider keeps its unsubscribes. An import can only ADD an opt-out — see below. | | `contacts[].created_at` | `string (ISO 8601)` | Original signup time. Applied on insert only; an existing contact keeps the date it already has. | | `contacts[].properties` | `object` | Custom properties. Merged into what the contact already has, not replaced — see Custom properties above. | An upsert only ever adds or corrects — it will not blank a field the payload does not carry, so importing `email` alone will not wipe the names of the contacts it touches. > [!WARNING] > **A batch write cannot re-subscribe anyone.** `unsubscribed: false` will not clear an existing > opt-out, and neither will omitting the field. If an address occurs more than once in a batch, any > `unsubscribed: true` occurrence preserves the opt-out. Re-subscribing is a consent decision and > lives on `PATCH /audiences/:id/contacts/:contactId`, one contact at a time — so a stale > spreadsheet can never put somebody back on a list they left. > [!NOTE] > Stored contacts are capped by volume — 1,000 on Free, rising to 1,000,000 at 2M emails a month > (see [plans](/docs/reference/plans)) — counted across every audience in the organization. A write > that would exceed the cap returns `403` with code `PLAN_LIMIT_EXCEEDED`. See [Plans & > Limits](/docs/reference/plans). ```bash title="batch upsert contacts" curl -X POST https://api.eusend.dev/audiences/550e8400-e29b-41d4-a716-446655440000/contacts/batch \ -H "Authorization: Bearer eu_live_xxxxxxxxxxxx" \ -H "Content-Type: application/json" \ -d '{ "contacts": [ { "email": "alice@example.com", "first_name": "Alice" }, { "email": "bob@example.com", "unsubscribed": true, "created_at": "2024-02-01T10:00:00.000Z" } ] }' ``` `POST /audiences/:id/contacts/batch-delete` Delete up to 1,000 contacts from an audience in one call. | Parameter | Type | Description | | --- | --- | --- | | `contact_ids` (required) | `string[]` | 1 to 1,000 contact ids. Ids from another audience are ignored, not deleted. | Returns `{ "deleted": n }`. That count can be lower than the number of ids you sent — an id may already be gone, or may not belong to this audience — so a retry after a dropped response settles at `0` rather than failing. It takes ids rather than addresses on purpose: ids come from a list you have just read, so a stale address in a script cannot delete somebody who re-subscribed under it since. > [!NOTE] > Deleting a contact is not an unsubscribe. It removes them from the audience; it does not add them > to your [suppression list](/docs/emails/suppressions), and anyone already suppressed stays > suppressed. To stop mailing somebody while keeping the record, set `unsubscribed` on the contact > instead. ```bash title="bulk delete contacts" curl -X POST https://api.eusend.dev/audiences/550e8400-e29b-41d4-a716-446655440000/contacts/batch-delete -H "Authorization: Bearer eu_live_xxxxxxxxxxxx" -H "Content-Type: application/json" -d '{ "contact_ids": ["9a8b7c6d-1111-2222-3333-444455556666"] }' ``` The rest of the contacts surface: `GET /audiences/:id/contacts` List contacts. Use `limit` (1–1,000, default 50) and the response's `nextCursor` as `cursor` to walk all pages. `search` matches a literal substring of the email address, first name, or last name, ignoring case. Set `subscribed=true` or `subscribed=false` to filter by subscription status. `GET /audiences/:id/contacts/:contactId` Get a contact. `PATCH /audiences/:id/contacts/:contactId` Update contact (name, unsubscribed, properties). `DELETE /audiences/:id/contacts/:contactId` Remove a contact. # Contact properties URL: https://eusend.dev/docs/audiences/properties Declare the custom fields your contacts carry, give them a type and a fallback value, and manage them from the API or the dashboard. Contact properties are the custom fields your contacts carry — `plan`, `company`, `renews_on` — and the `{{variables}}` they render as in a broadcast. This page is about the **definitions**; setting a value on a contact is covered in [Contacts](/docs/audiences/contacts). > [!NOTE] > **Declaring a property is optional.** A property you send on a contact that has never been > declared registers itself as a `string`, so an existing integration needs no changes. Declaring > one up front is what gives it a type and a fallback value. Definitions belong to the organization, not to one audience: `signup_plan` means the same thing wherever the contact sits, so a contact moved between lists does not change shape. Properties are also listed in the dashboard under **Audiences → Properties**, where the same add, edit and delete operations are available. ## Fallback values [#fallback-values] A declared property can carry a fallback, substituted into `{{key}}` for contacts that have no value of their own: ```bash title="everyone without a plan reads as 'free'" curl -X POST https://api.eusend.dev/contact-properties \ -H "Authorization: Bearer eu_live_xxxxxxxxxxxx" \ -H "Content-Type: application/json" \ -d '{ "key": "plan", "type": "string", "fallback_value": "free" }' ``` This is the durable version of the inline `{{plan|free}}` syntax: set it once and every broadcast picks it up, instead of each body having to remember the default. A property with no fallback renders empty, which is what an unset `{{key}}` has always done. ## Types [#types] `string` or `number`. Values are carried and rendered as strings either way — `number` is a **write-time check**, not a formatting instruction. A merge tag has nowhere to say which thousands separator or which locale it wanted, so `{{order_total}}` substitutes exactly the characters you sent. What the type buys is catching a mistyped value where it is cheap to fix, rather than in an email somebody already received. `POST /contact-properties` | Parameter | Type | Description | | --- | --- | --- | | `key` (required) | `string` | Lowercase letters, digits and underscores, starting with a letter, at most 40 characters. "email", "name", "first_name", "last_name" and "full_name" are built in and are rejected. Cannot be changed later. | | `type` | `string` | "string" (default) or "number". Cannot be changed later. | | `fallback_value` | `string \| null` | Rendered for contacts carrying no value of their own. Must match the type. At most 500 characters. | Returns `409 CONFLICT` if a property with that name already exists. An organization can define up to 100 properties. `GET /contact-properties` Every property the organization has defined, ordered by name. Unpaginated — the registry is capped at 100 entries, and a variable picker wants all of them. ```json title="response" { "data": [ { "id": "b6d24b8e-af0b-4c3c-be0c-359bbd97381e", "key": "plan", "type": "string", "fallbackValue": "free", "createdAt": "2026-09-21T10:14:52.110Z", "updatedAt": "2026-09-21T10:14:52.110Z" } ] } ``` `GET /contact-properties/:id` One property definition by id. `PATCH /contact-properties/:id` | Parameter | Type | Description | | --- | --- | --- | | `fallback_value` (required) | `string \| null` | The new fallback. Send null to clear it. | > [!WARNING] > **The name and type cannot be changed.** Renaming would have to rewrite every contact *and* every > broadcast body that spells the old merge tag — and we will not edit your drafts. Changing either > is a delete and a create, done deliberately. `DELETE /contact-properties/:id` Deletes the definition **and** strips the key from every contact in the organization. The response reports how many contacts were rewritten: ```json title="response" { "deleted": true, "contactsUpdated": 1240 } ``` > [!WARNING] > **This cannot be undone.** Leaving the values behind was the alternative and a worse one: the > property would keep rendering in broadcasts, and the next contact write carrying that key would > register it again — so a delete you watched succeed would silently undo itself. Any broadcast > using that merge tag renders it empty afterwards. ## In the dashboard [#in-the-dashboard] **Audiences → Properties** lists every declared property with the number of contacts using it, and is where you add, edit and delete them. The count is what makes a delete legible: removing a field nothing uses is a different decision from removing one on 1,240 people. ## SDKs [#sdks] ```ts title="Node.js" await eusend.contactProperties.create({ key: 'plan', type: 'string', fallbackValue: 'free' }) const { data } = await eusend.contactProperties.list() ``` ```python title="Python" eusend.ContactProperties.create({"key": "plan", "type": "string", "fallback_value": "free"}) properties = eusend.ContactProperties.list() ``` ```go title="Go" fallback := "free" client.ContactProperties.Create(&eusend.CreateContactPropertyRequest{ Key: "plan", Type: "string", FallbackValue: &fallback, }) ``` # Topics URL: https://eusend.dev/docs/audiences/topics Named categories of email your contacts can subscribe to and leave independently, so an unsubscribe becomes a preference change instead of losing the contact entirely. A topic is a kind of email — "Monthly newsletter", "Product updates", "Beta programme" — that a contact can join or leave on its own. Scope a broadcast to a topic and it reaches only the people who want that kind of mail. Without topics, a recipient who likes the monthly newsletter but not the weekly product blast has exactly one lever: leave. The lever they reach for when leaving feels too blunt is the spam button, and that costs every sender on the shared IPs — which is the real reason this feature exists. Topics belong to the organization, not to one audience, so "Product updates" means the same thing wherever the contact sits. ## Opt-in or opt-out [#opt-in-or-opt-out] Every topic has a default that decides what a contact who has never expressed a preference receives: | Default | A contact who has never chosen | | --------- | --------------------------------------------------- | | `opt_in` | **receives** it, until they explicitly unsubscribe | | `opt_out` | **does not** receive it, until they explicitly join | Use `opt_in` for mail the list signed up for — your newsletter is the obvious case. Use `opt_out` for anything a contact has to ask for: a beta programme, a high-frequency digest, a regional announcement. > [!WARNING] > **The default cannot be changed after creation.** Flipping an `opt_out` topic to `opt_in` would > start mailing every contact who never asked for it, and nothing stored anywhere says which of them > would have agreed. It is a consent decision, so changing it means creating a new topic. Because a new `opt_in` topic reaches everyone immediately and a new `opt_out` topic reaches nobody, neither needs a backfill — only explicit choices are stored. ## The global subscription still wins [#the-global-subscription-still-wins] A contact whose subscription is off receives **nothing**, whatever their topic preferences say. Topics narrow who gets a broadcast; they never widen it. Unsubscribing from every topic is also not the same as unsubscribing from the list — see [Unsubscribes](/docs/audiences/unsubscribe). ## Visibility [#visibility] `private` (the default) or `public`, controlling whether the topic is listed on the hosted unsubscribe page to a contact who is **not** already opted in. Keep a topic private when its name is an internal one. Advertising "Enterprise outreach" to someone who is not on it tells them something you probably did not mean to, and the natural response to an unfamiliar name on an unsubscribe page is to untick it. A `public` topic is one you are happy for anyone to discover and join. A private topic is always shown to a contact who explicitly opted in — otherwise they would have no way to leave it. ## Sending to a topic [#sending-to-a-topic] Pass `topic_id` when creating a broadcast: ```bash title="only the people who want product updates" curl -X POST https://api.eusend.dev/broadcasts \ -H "Authorization: Bearer eu_live_xxxxxxxxxxxx" \ -H "Content-Type: application/json" \ -d '{ "name": "October product update", "audience_id": "550e8400-e29b-41d4-a716-446655440000", "topic_id": "b6d24b8e-af0b-4c3c-be0c-359bbd97381e", "from": "hello@acme.com", "subject": "What shipped in October", "html": "

Hi {{first_name}}…

" }' ``` The recipient count shown on the broadcast reflects the topic, so it matches what is actually sent. PATCH `topic_id` to `null` on a draft to widen it back to the whole audience. A broadcast sent under a topic also carries a **topic-scoped unsubscribe link**: the footer link and the `List-Unsubscribe` header both retire that topic rather than the whole list, so one-click unsubscribe in Gmail becomes a preference change. > [!NOTE] > Topics scope **broadcasts only.** `POST /emails` is untouched — a receipt or a password reset must > never be filtered by a marketing preference. `POST /topics` | Parameter | Type | Description | | --- | --- | --- | | `name` (required) | `string` | What the recipient sees on the unsubscribe page if the topic is visible to them. At most 50 characters, unique within the organization. | | `default_subscription` (required) | `string` | "opt_in" or "opt_out". Cannot be changed later. | | `description` | `string \| null` | Shown under the name on the unsubscribe page. At most 200 characters. Worth writing — it is what tells a recipient whether to keep the box ticked. | | `visibility` | `string` | "private" (default) or "public". | ```json title="response — 201 Created" { "id": "b6d24b8e-af0b-4c3c-be0c-359bbd97381e", "name": "Product updates", "description": "New features and changes.", "defaultSubscription": "opt_in", "visibility": "public", "subscriberCount": 0, "createdAt": "2026-09-22T10:14:52.110Z", "updatedAt": "2026-09-22T10:14:52.110Z" } ``` Returns `409 CONFLICT` if a topic with that name already exists, and `403 PLAN_LIMIT_EXCEEDED` past 100 topics. `GET /topics` Every topic in the organization, ordered by name. Unpaginated — the list is capped at 100 and both the composer's picker and the unsubscribe page want all of it. `subscriberCount` is the number of contacts who have **explicitly opted in**. For an `opt_out` topic that is the whole reachable audience; for an `opt_in` topic it is not, since everyone who never chose is also subscribed. `GET /topics/:id` One topic by id. `PATCH /topics/:id` | Parameter | Type | Description | | --- | --- | --- | | `name` | `string` | At most 50 characters. | | `description` | `string \| null` | Send null to clear it. | | `visibility` | `string` | "public" or "private". | `default_subscription` is rejected here — see the warning above. `DELETE /topics/:id` ```json title="response" { "id": "b6d24b8e-af0b-4c3c-be0c-359bbd97381e", "deleted": true } ``` Every stored preference for the topic goes with it. A **draft** broadcast scoped to it widens back to its whole audience. While a broadcast scoped to it is scheduled, sending, paused or held, the delete is refused with `409 CONFLICT` — cancel it first, so a send that is about to go out can never reach contacts who opted out of the topic. Broadcasts already sent keep their recipient records. ## Setting a contact's preference [#setting-a-contacts-preference] `PUT /topics/:id/contacts/:contactId` ```bash title="subscribe a contact" curl -X PUT https://api.eusend.dev/topics/b6d24b8e/contacts/9f1c2d3e \ -H "Authorization: Bearer eu_live_xxxxxxxxxxxx" \ -H "Content-Type: application/json" \ -d '{ "subscribed": true }' ``` `DELETE /topics/:id/contacts/:contactId` Clears the override so the contact falls back to the topic's default. This is different from `{ "subscribed": false }`: it forgets that they ever chose, so on an `opt_in` topic they start receiving it again. ## On the unsubscribe page [#on-the-unsubscribe-page] A recipient who clicks unsubscribe gets a checkbox per visible topic and a **Save preferences** button, alongside the usual unsubscribe-from-everything button. No JavaScript, no login — it is the same hosted page, branded the same way. Organizations with no topics see exactly the page they saw before. ## SDKs [#sdks] ```ts title="Node.js" const { data: topic } = await eusend.topics.create({ name: 'Product updates', defaultSubscription: 'opt_in', visibility: 'public', }) await eusend.topics.subscribe(topic.id, contactId, true) ``` ```python title="Python" topic = eusend.Topics.create({"name": "Product updates", "default_subscription": "opt_in"}) eusend.Topics.subscribe(topic["id"], contact_id, True) ``` ```go title="Go" topic, _ := client.Topics.Create(&eusend.CreateTopicRequest{ Name: "Product updates", DefaultSubscription: "opt_in", }) client.Topics.Subscribe(topic.Id, contactId, true) ``` # Unsubscribe URL: https://eusend.dev/docs/audiences/unsubscribe Broadcast emails include a one-click unsubscribe link pointing to a hosted unsubscribe page. Broadcast emails include a footer unsubscribe link pointing to a hosted unsubscribe page, so recipients can opt out with a single click. ## How it works [#how-it-works] When a recipient clicks "Unsubscribe", they're directed to a hosted page at `https://api.eusend.dev/unsubscribe/:token`. Confirming removes them from the audience and prevents future broadcasts. The contact record is retained — only the subscription status changes. > [!WARNING] > Unsubscribed contacts are excluded from all future broadcast sends to that audience. They are > **not** automatically suppressed from transactional emails sent via `POST /emails`. ## Branding the page [#branding-the-page] Settings → **Unsubscribe page** styles the hosted page for your whole organization: background, text and accent colors, a logo, and the wording of both the confirmation and the success screen. A live preview renders the same page the recipient will see. Colors must be hex values, and the logo is uploaded there — the page loads images from our asset host only, so a recipient's unsubscribe never fetches a third party. Copy is plain text; the confirm button itself can be relabelled but not removed, because a link scanner following the URL must not be able to opt someone out on their behalf. The "Powered by eusend" footer can be switched off on any paid plan. ## Suppression list [#suppression-list] Hard bounces and spam complaints automatically add addresses to your suppression list. Suppressed addresses are silently skipped on all future sends (including transactional emails). See [Suppressions](/docs/emails/suppressions) for reading, importing, and removing entries. # Broadcasts URL: https://eusend.dev/docs/broadcasts Campaigns sent to an entire audience. Create a broadcast as a draft, then send or schedule it. > [!NOTE] > **Sending a broadcast to an audience requires a paid plan.** On Free you can create audiences, > build and preview broadcasts, and send test copies to your own account email or an address on a > verified domain — `POST /broadcasts/:id/send` returns `403` with code `PLAN_LIMIT_EXCEEDED`. Broadcasts are campaigns sent to an entire audience (contact list). Create a broadcast as a draft, then send it when ready. In-flight broadcasts can be cancelled. ## Lifecycle [#lifecycle] `draft` → `scheduled` → `sending` → `sent` → `cancelled` A broadcast can also move to `paused` if sending is halted partway — for example it reaches your monthly or daily send limit, the sender domain is no longer verified, or platform-wide sending is paused. Resume it by sending again (`POST /broadcasts/:id/send`) once the underlying issue is resolved — it continues from where it stopped. ### Review on early list sends [#review-on-early-list-sends] New accounts can reach **500 recipients** by broadcast before we've reviewed the account. Most first campaigns are smaller than that and go out in full, with nothing to do. If your audience is larger, the first 500 are delivered immediately and the broadcast moves to `held` with the rest queued behind a quick manual review. You'll get an email when it's released, and the broadcast continues from where it stopped — nothing is lost and nobody is emailed twice. Unlike `paused`, a held broadcast can't be resumed by sending again; `POST /broadcasts/:id/send` returns `403` with code `BROADCAST_HELD` until the review clears. The same allowance applies to very large `POST /emails/batch` sends, which return `LIST_SEND_HELD` on the items beyond it. This is a one-time step per account, not a recurring limit. It exists so one bad actor can't damage the sending reputation that every customer on the platform shares. If you're on a deadline, email `support@eusend.dev` and we'll clear it. > [!NOTE] > Sending from a domain registered in the last 30 days? The same 500-recipient allowance applies to > broadcasts until the account is reviewed. Transactional sending through `POST /emails` is > unaffected — send from a brand-new domain from day one. ## API endpoints [#api-endpoints] `POST /broadcasts` | Parameter | Type | Description | | --- | --- | --- | | `name` (required) | `string` | Internal name for the campaign. | | `audience_id` (required) | `string (UUID)` | The audience (contact list) this broadcast is sent to. | | `subject` (required) | `string` | Email subject line. | | `from` (required) | `string` | Sender address. Accepts a bare email or a display name, e.g. "Acme ". Must be from a verified domain. | | `reply_to` | `string` | Reply-To address for the campaign. Same format as from. Omit to have replies go to the sender address. | | `html` | `string` | HTML body. Required unless template_id is provided. A plain-text part is generated automatically. | | `template_id` | `string (UUID)` | Saved template to use instead of html. | | `template_variables` | `object` | Default {{variable}} values applied to every recipient (per-contact fields like first_name and custom properties override these). | | `track_opens` | `boolean` | Embed the open-tracking pixel. Omit to use your organization default (off unless changed under Settings → General → Email tracking). Resolved once at creation and kept for the life of the broadcast. | | `track_clicks` | `boolean` | Rewrite links to record clicks. Omit to use your organization default. Unsubscribe links are unaffected either way. | | `topic_id` | `string (UUID)` | Send only to contacts subscribed to this topic. Set it to null on a draft to send to the whole audience again. See Topics. | ```bash title="create broadcast" curl -X POST https://api.eusend.dev/broadcasts \ -H "Authorization: Bearer eu_live_xxxxxxxxxxxx" \ -H "Content-Type: application/json" \ -d '{ "name": "May Newsletter", "audience_id": "550e8400-e29b-41d4-a716-446655440000", "subject": "What'"'"'s new in May", "from": "newsletter@acme.com", "html": "

Hello!

Here'"'"'s what'"'"'s new...

" }' ``` `POST /broadcasts/:id/send` Send a draft broadcast immediately, or schedule it for a future time by passing `scheduled_at`. This endpoint also **resumes a paused broadcast** — it continues from where it stopped, skipping recipients already sent. The audience is set when creating the broadcast. Broadcasts can also be pre-scheduled via `PATCH /broadcasts/:id` without triggering a send; that runs the same checks as this endpoint, so a broadcast that could not be sent cannot be scheduled either. Unsubscribed and suppressed contacts are skipped. So are contacts at a domain that can never receive mail — no mail server that can be reached, such as a parked typo like `gmaii.com`, or a reserved name like `example.com`. Each of those gets an email with status `failed` and the reason, and an `email.failed` webhook, instead of being sent and bouncing against your reputation; they use none of your quota. | Parameter | Type | Description | | --- | --- | --- | | `scheduled_at` | `string (ISO 8601)` | Future UTC datetime to deliver the broadcast. Omit to send immediately. Sets status to scheduled until the delivery time. | ```bash title="schedule a broadcast" curl -X POST https://api.eusend.dev/broadcasts/3fa85f64-5717-4562-b3fc-2c963f66afa6/send \ -H "Authorization: Bearer eu_live_xxxxxxxxxxxx" \ -H "Content-Type: application/json" \ -d '{ "scheduled_at": "2026-06-01T09:00:00Z" }' ``` `POST /broadcasts/:id/test` Send yourself a copy of the broadcast before it goes to the audience — the real message, through the real sending path, so you see exactly what a recipient sees. **Available on every plan, including Free.** This is how you evaluate a broadcast without a paid subscription. Recipients must be inboxes you already control: a team member's account email, or an address on a **domain you have verified**. A test send puts real mail on the wire without the plan gate, so pass an address anywhere else and you get `403` with code `DOMAIN_NOT_VERIFIED`. | Parameter | Type | Description | | --- | --- | --- | | `to` (required) | `string[]` | Between 1 and 5 addresses, each a team member's account email or on a domain this organization has verified. Duplicates are collapsed. | What a test send does and does not do: * Subject is prefixed with `[Test]`, so a test copy is never mistaken for the campaign. * Contact variables render with sample values (`{{first_name}}` becomes `Alex`), rather than collapsing to an empty string and hiding a greeting that will look wrong later. [Custom properties](/docs/audiences/contacts#custom-properties) are borrowed from a real contact in the audience, since only your data knows what `{{plan}}` should look like. * The unsubscribe footer is included so you can see it, but its link is inert — there is no contact behind a test send to unsubscribe. * It counts against your daily and monthly sending limits, because it is a real send. * Addresses on your suppression list are skipped and cost nothing. If every address is suppressed, the request fails with `422 ALL_SUPPRESSED`. * It does **not** change the broadcast's status, its recipient list, or its stats. Send as many tests as you like; the campaign stays a draft until you send it. ```bash title="send a test copy to yourself" curl -X POST https://api.eusend.dev/broadcasts/3fa85f64-5717-4562-b3fc-2c963f66afa6/test \ -H "Authorization: Bearer eu_live_xxxxxxxxxxxx" \ -H "Content-Type: application/json" \ -d '{ "to": ["you@yourdomain.com"] }' ``` > [!WARNING] > A test-mode key (`eu_test_`) cannot call this endpoint. "Test" here means a dress rehearsal, not a > sandbox — the message really is delivered, so it needs a live key. `POST /broadcasts/:id/cancel` Cancel a scheduled or in-flight broadcast. Emails already sent are not recalled. The rest of the broadcast surface: `GET /broadcasts` List broadcasts. `GET /broadcasts/:id` Get broadcast details. `PATCH /broadcasts/:id` Update draft / set `scheduled_at`. # Contacts CSV URL: https://eusend.dev/docs/dashboard/contacts-csv Import and export contacts in bulk from any audience detail page, with automatic column mapping. Audiences support bulk contact management via CSV import and export, from any audience detail page. ## Importing [#importing] Choose **Import CSV** and pick a file. Nothing is sent until you have confirmed the mapping. ### 1. We read your header row [#1-we-read-your-header-row] The file is parsed in your browser. The delimiter is detected rather than assumed — comma, semicolon, tab and pipe all work, so a spreadsheet exported by Excel in a European locale (which uses `;`) imports without you having to convert it first. Quoted fields are handled properly, so a value like `"Doe, Jane"` stays one field. ### 2. We map the columns for you [#2-we-map-the-columns-for-you] Each column is matched to a eusend property, and you get a table showing the column name, a sample value from your file, and the property we chose. Every row is editable: change a mapping, or untick a column to leave it out. Matching is case- and punctuation-insensitive, so `Email`, `email_address` and `E-Mail Address` all find `email`. Columns we don't recognise are left unmapped rather than guessed at. | Property | Required | Description | | ------------ | -------- | ------------------------------------------------------------------------------------- | | `email` | yes | Contact email address. Rows without a valid address are skipped and counted. | | `first_name` | no | Used in `{{first_name}}` template variables. | | `last_name` | no | Used in `{{last_name}}`. | | `subscribed` | no | `false`, `no`, `0` or `unsubscribed` opts the contact out. Anything else is opted in. | | `created_at` | no | Original signup time. Applied to new contacts only. | Any other column can be brought in as a [custom property](/docs/audiences/contacts#custom-properties): pick **Custom property** in that column's dropdown and it is stored under a name derived from the header, so `Plan Name` becomes `plan_name` and renders as `{{plan_name}}` in a broadcast. A header that would collide with a built-in variable is prefixed rather than refused — a column headed `Email` mapped as a property becomes `custom_email`. A contact holds at most 20 properties; columns past that are left out rather than failing the import, and values longer than 500 characters are truncated. Empty cells are skipped, not written as blanks — see the rules below. ### 3. Import [#3-import] Contacts are upserted in chunks of 1,000, so a list of any size imports in one go. Addresses are lowercased and de-duplicated — if the same address appears twice, the last row wins, and the summary tells you how many were merged. ## What an import will never do [#what-an-import-will-never-do] Re-importing a list is a normal thing to do, and it is safe. Two rules make it so: * **An unmapped column changes nothing.** Importing a file of just `email,subscribed` will not blank the names of the contacts it touches. * **An empty cell changes nothing either.** Properties merge rather than replace, so a blank `plan` cell leaves whatever `plan` the contact already had. To clear a property, edit the contact. * **An import can add an opt-out, never remove one.** If somebody has unsubscribed, a spreadsheet saying otherwise will not put them back on the list — not with `subscribed,true`, and not by omitting the column. Re-subscribing is a consent decision, so it lives on the contact itself (or `PATCH /audiences/:id/contacts/:contactId`), one person at a time. ## Exporting [#exporting] Exported files use the full column set and can be re-imported without losing anything — including who has unsubscribed and when each contact joined. ```csv title="export column order" email,first_name,last_name,subscribed,created_at ``` Every custom property present in the exported contacts is appended as its own column, named exactly as the property is. Those names round-trip: re-importing the file matches each one straight back onto the property it came from. ## Editing one contact [#editing-one-contact] The bulk paths are for lists. To change a single contact — its name, whether it is subscribed, or its custom properties — use the pencil on its row in the contacts table. Unlike an import, that editor **replaces** the property set, so removing a row there removes the property from the contact. ## Importing through the API [#importing-through-the-api] The dashboard is doing what you could do yourself: ```ts await client.audiences.batchCreateContacts(audienceId, { contacts: [ { email: 'alice@example.com', firstName: 'Alice', lastName: 'Smith' }, { email: 'bob@example.com', unsubscribed: true, createdAt: '2024-02-01T10:00:00.000Z' }, ], }) ``` Up to 1,000 contacts per call. See [Audiences and contacts](/docs/audiences/contacts) for the full endpoint. # Domain Setup (UI) URL: https://eusend.dev/docs/dashboard/domain-setup Adding a domain from the dashboard walks you through a 3-step wizard — no API calls needed. Adding a domain from the dashboard walks you through a 3-step wizard. No API calls needed — DNS records are generated and shown inline with copy buttons. ### Enter your domain [#enter-your-domain] Type your domain name (e.g. acme.com) and click Add Domain. eusend generates a 2048-bit RSA DKIM keypair immediately. ### Add DNS records [#add-dns-records] The records are shown with one-click copy. Only the DKIM TXT record is required to verify the domain and start sending; DMARC is recommended, and the two Return-Path records are optional and enable SPF alignment. Adding them by hand? [DNS providers](/docs/domains/registrars) gives the exact field values for the most common DNS panels, and the mistakes each one invites. ### Verify [#verify] Click "I've added these records" to trigger verification. eusend polls your DNS until the records propagate and marks the domain verified — or reports which records are missing. > [!NOTE] > DNS propagation typically takes under an hour but can take up to 48 hours. The dashboard polls > automatically after you click verify — you don't need to stay on the page. The domain status > updates to **verified** once all records are found. ## DNS records added [#dns-records-added] | Record | Type | Purpose | | ---------------------------- | ----- | ------------------------------------------------------------------------- | | `eusend._domainkey.acme.com` | `TXT` | DKIM — enables cryptographic email signing. Required | | `_dmarc.acme.com` | `TXT` | DMARC — policy for failed SPF/DKIM checks. Recommended | | `send.acme.com` | `TXT` | SPF for the Return-Path subdomain. Optional — enables SPF alignment | | `send.acme.com` | `MX` | Routes delayed bounces back to us. Optional — pairs with the record above | > [!WARNING] > There is no SPF record on your root domain, deliberately. A domain may publish only one, and > adding a second breaks SPF for every service that sends from it — your own mailbox provider > included. See [DNS records](/docs/domains/dns-records) for why it isn't needed. # Logs URL: https://eusend.dev/docs/dashboard/logs Every request your API keys make, with the request and response of the ones that failed. The **Logs** page at [`/logs`](/logs) lists every request made with one of your API keys: method, path, status code, duration, which key made it, and when. Use it to find out why an integration is failing without adding logging to your own code. * **Filter** by status (success, 4xx, 5xx), API key, path, and period (24 hours, 7 days or 30 days). * **Click a row** to see the request ID, the client's user agent (the SDKs send their name and version), and — for failed requests — the request body you sent and the error response you got back. * **Share the request ID** with support. It is the same value returned in the `X-Request-Id` response header, so it links a failing call to our own logs. ## What is and isn't logged [#what-is-and-isnt-logged] * Only requests authenticated with an API key are logged, including test-mode keys. Requests with a missing or invalid key have no workspace to be logged under, and actions you take in the dashboard are not listed. * Request and response bodies are kept only for failed requests (status 400 or above). Attachment content is replaced with `[omitted]`, and bodies over 16 KB are truncated. * Headers are never stored, so your API key does not appear in the logs. * Logs are kept for **30 days** on every plan, then deleted. * New requests appear within a few seconds. # Overview URL: https://eusend.dev/docs/dashboard/overview The eusend dashboard lets you do everything the API does — no code required. The eusend dashboard at [eusend.dev](/login) lets you do everything the API does — no code required. Here's what each section is for. | Path | Section | Purpose | | ------------------- | ------------------ | ------------------------------------------------------------------------------------------------------------------------------------------- | | `/overview` | Overview | Volume against your plan, recent activity, bounce and complaint rates, delivery by recipient domain, and anything that needs fixing. | | `/emails` | Emails | Full log of every send. Filter by status, sender, or recipient. Click any row for the event timeline (sent → delivered → opened → clicked). | | `/analytics` | Analytics | Charts for send volume, open rate, and click rate over time. Filterable by time period and domain. | | `/templates` | Templates | Create and edit email templates in a visual editor with live preview. Reference templates by ID in any send. | | `/audiences` | Audiences | Manage contact lists. Import and export contacts via CSV. Used as the target for broadcasts. | | `/broadcasts` | Broadcasts | Compose and schedule marketing campaigns. Send immediately or set a future delivery time. | | `/domains` | Domains | Add sending domains and copy the generated DNS records. A 3-step wizard walks you through setup and verification. | | `/api-keys` | API Keys | Create and revoke live (`eu_live_`) and test (`eu_test_`) keys. Free plan allows 1 live and 1 test key; paid plans are unlimited. | | `/webhooks` | Webhooks | Register HTTPS endpoints to receive real-time delivery events. The signing secret is shown at creation and can be revealed again later. | | `/logs` | Logs | Every request made with your API keys, with the request and response of failed ones. See [Logs](/docs/dashboard/logs). | | `/settings/billing` | Settings → Billing | Upgrade, downgrade, or cancel your plan. Current usage and monthly quota shown inline. | | `/settings/team` | Settings → Team | Invite team members by email, set their role, and see who has two-factor enabled. See [Teams & Workspaces](/docs/teams). | # Template Editor URL: https://eusend.dev/docs/dashboard/templates Write and preview email templates in real time. The rendered HTML is stored and used at send time. The template editor at `/templates` lets you write and preview email templates in real time. The rendered HTML is stored and used at send time. ## Variables [#variables] Use `{{variable_name}}` anywhere in the subject or HTML body to create a variable. The editor detects them automatically and shows a panel where you can enter sample values for the preview. At send time, pass the actual values via the `variables` field. > [!NOTE] > Variable values are HTML-escaped when substituted, so they always render as text — a value like ` hi` shows literally rather than as bold. Any HTML structure (links, formatting) must live > in the template body, not in the variable values you pass. ```html title="template HTML"

Hi {{first_name}}!

Your order #{{order_id}} has shipped.

Track your package

``` ```bash title="send with variables" curl -X POST https://api.eusend.dev/emails \ -H "Authorization: Bearer eu_live_xxxxxxxxxxxx" \ -H "Content-Type: application/json" \ -d '{ "from": "orders@acme.com", "to": "alice@example.com", "template_id": "550e8400-e29b-41d4-a716-446655440000", "variables": { "first_name": "Alice", "order_id": "1234", "tracking_url": "https://track.example.com/1234" } }' ``` > [!NOTE] > Templates are rendered once when saved (not at send time), so the preview you see in the editor is > exactly what will be sent. Variable substitution is the only step that happens per send. ## Editor layout [#editor-layout] The canvas is a visual editor — you write the email as it will look, with a style inspector alongside it for the block you have selected. Two mode tabs sit above it: | Mode | What it shows | | --------- | ------------------------------------------------------------------------------------ | | **Write** | The visual editor. Type `{{` to insert a variable. | | **HTML** | The underlying HTML, editable directly for anything the visual editor doesn't cover. | Below the canvas, **Variables** lists every `{{placeholder}}` detected in the template, **Preview with sample data** gives you an input per variable and renders the result live, and **Use in API** shows the `POST /emails` body for sending this template. Saving stores the rendered HTML plus the editor document, so reopening a template gives you back the visual editor rather than raw markup. Editing the HTML mode directly and saving drops the stored editor document — the HTML you wrote stays authoritative. # Domain Setup URL: https://eusend.dev/docs/domains Add your own sending domain to sign outbound emails with your DKIM key, improving deliverability and brand trust. Add your own sending domain to sign outbound emails with your DKIM key, improving deliverability and brand trust. eusend auto-generates a 2048-bit RSA DKIM keypair for your domain. `POST /domains` | Parameter | Type | Description | | --- | --- | --- | | `name` (required) | `string` | Your domain name (e.g. acme.com), without the part before an @. Domains of mailbox providers such as gmail.com cannot be added — you can only send from a domain you control. | ```bash title="add domain" curl -X POST https://api.eusend.dev/domains \ -H "Authorization: Bearer eu_live_xxxxxxxxxxxx" \ -H "Content-Type: application/json" \ -d '{ "name": "acme.com" }' ``` ```json title="response — 201 Created" { "id": "7c9e6679-7425-40de-944b-e07fc1f90ae7", "name": "acme.com", "dkim": { "type": "TXT", "name": "eusend._domainkey.acme.com", "value": "v=DKIM1; k=rsa; p=MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgK..." }, "dmarc": { "type": "TXT", "name": "_dmarc.acme.com", "value": "v=DMARC1; p=none; rua=mailto:dmarc@acme.com" } } ``` Creating a domain starts checking its DNS for you — eusend polls in the background and flips the domain to `verified` as soon as your records resolve, so publishing them is usually all you need to do. `POST /domains/:id/verify` Start a fresh check right now. Use it when you published the records late, or corrected them after a `failed`: eusend re-checks your DNS and updates the domain status to `verified` or `failed`. The rest of the domains surface: `GET /domains` List domains. `GET /domains/:id` Get domain details, including the DNS records to publish and a `diagnostic` object when a check found something wrong with what is already published — the record sitting under your domain twice because the panel appends it, a key cut off at the 255-character limit for one DNS string, or a DKIM key we did not issue on the same selector. It names the DNS host when your nameservers identify one, and is `null` whenever the only thing missing is propagation. ```json title="response — 200 OK, a record published at the wrong name" { "id": "7c9e6679-7425-40de-944b-e07fc1f90ae7", "name": "acme.com", "status": "pending", "diagnostic": { "code": "doubled_domain", "foundAt": "eusend._domainkey.acme.com.acme.com", "provider": { "id": "namecheap", "label": "Namecheap", "guide": "/docs/domains/registrars/namecheap" } } } ``` See [DNS providers](/docs/domains/registrars) for the panel-by-panel instructions the `guide` path points at. `DELETE /domains/:id` Delete domain. # DMARC URL: https://eusend.dev/docs/domains/dmarc Tell receiving mail servers how to handle messages that fail authentication — protecting your domain from spoofing. DMARC lets you tell receiving mail servers how to handle messages that fail authentication checks for your domain — protecting your domain from being used in phishing and spoofing attacks. ## How it works with eusend [#how-it-works-with-eusend] DMARC passes when either DKIM or SPF is aligned with your sending domain — it doesn't require both. Because eusend signs every outbound email with your own DKIM key (set up during domain verification), DKIM alignment passes automatically. You can add a DMARC record to your domain straight away without any additional infrastructure changes. ## Add a DMARC record [#add-a-dmarc-record] Add the following TXT record to your domain's DNS. Start with a `p=none` policy so you can monitor results before enforcing anything. | Type | Host / Name | Value | | ----- | ----------------- | ---------------------------------------------- | | `TXT` | `_dmarc.acme.com` | `v=DMARC1; p=none; rua=mailto:dmarc@acme.com;` | > [!NOTE] > Replace `dmarc@acme.com` with a real address you control. Receiving servers send aggregate reports > to this address — XML digests of authentication results across all email from your domain, > typically once a day. ## Tightening the policy [#tightening-the-policy] Once you've confirmed your emails are passing DMARC (check the `Authentication-Results` header in any received email, or wait for aggregate reports), you can switch to a stricter policy: | Policy | Effect | | -------------- | ----------------------------------------------------------------------------- | | `p=none` | No action taken. Reports are still sent. Use this while monitoring. | | `p=quarantine` | Failing messages go to spam. A good middle ground once delivery is confirmed. | | `p=reject` | Failing messages are bounced outright. Maximum protection. | > [!TIP] > Only move to `p=reject` once you're certain all legitimate email from your domain passes DKIM or > SPF. Any service sending on your behalf — transactional email, marketing tools, CRMs — needs to be > authenticated before you enforce rejection. ## DMARCbis: the updated standard [#dmarcbis-the-updated-standard] In May 2026 DMARC was revised and promoted to a full IETF standard — **DMARCbis** (RFC 9989–9991, replacing the original RFC 7489). Nothing you've already published breaks: the record eusend generates uses only long-stable tags and is fully DMARCbis-compatible. A few tags did change, though. ### Deprecated tags — don't add them [#deprecated-tags--dont-add-them] | Tag | Status | | ----- | ------------------------------------------------------------------------------------- | | `pct` | Removed. Percentage-based enforcement is gone; use `t=y` (below) for testing instead. | | `rf` | Removed. Reports are XML-only. | | `ri` | Removed. Receivers choose their own report interval. | If an older tutorial tells you to add `pct=100`, skip it — it's a no-op that some validators now flag. ### `np` — block non-existent subdomains [#np--block-non-existent-subdomains] The headline DMARCbis addition is `np`, a policy for mail from **subdomains that don't exist**. Attackers love spoofing addresses like `billing.acme.com` even when you've never created that subdomain. Because a non-existent subdomain never sends legitimate mail, you can set `np=reject` safely — even while your main policy is still `p=none` for monitoring: | Type | Host / Name | Value | | ----- | ----------------- | --------------------------------------------------------- | | `TXT` | `_dmarc.acme.com` | `v=DMARC1; p=none; np=reject; rua=mailto:dmarc@acme.com;` | `np` only applies to subdomains with no DNS records at all. A sending subdomain you've verified in eusend (it carries a DKIM record, so it "exists") is unaffected and follows your `sp`/`p` policy instead. ### `t` — testing mode [#t--testing-mode] `t=y` marks a policy as testing: receivers evaluate `p`/`sp`/`np` and send reports but take no action, the way `pct=0` used to. Use it to trial a stricter policy without risking delivery, then remove it to enforce. > [!NOTE] > These tags are optional hardening. The record eusend gives you at domain verification already > follows the safe `p=none` → `p=quarantine` → `p=reject` path; adding `np=reject` is the one change > worth making early, since it costs nothing and closes the subdomain-spoofing gap. # DNS Records URL: https://eusend.dev/docs/domains/dns-records Add these records to your domain's DNS to enable DKIM signing and improve deliverability. Add these records to your domain's DNS to enable DKIM signing and improve deliverability. If you want click-by-click instructions for the panel you are actually looking at — Cloudflare, Namecheap, Route 53, Squarespace, Porkbun, OVHcloud, Gandi or IONOS — see [DNS providers](/docs/domains/registrars). ## DKIM record [#dkim-record] The DKIM public key is returned when you add a domain. Add it as a TXT record: | Type | Host / Name | Value | | ----- | ---------------------------- | ------------------------------------- | | `TXT` | `eusend._domainkey.acme.com` | `v=DKIM1; k=rsa; p=` | ## SPF [#spf] **You do not need to add an SPF record on your root domain, and you should not.** SPF authenticates the envelope sender (the bounce address), not the `From:` header. Mail we send carries our own bounce domain, so an SPF record on `acme.com` is never consulted for it — it authorises nothing on your behalf. It can also do harm. A domain may publish only **one** SPF record; a second one makes SPF fail for *every* service sending from that domain, including your own mailbox provider. If you already have an SPF record for Google Workspace, Microsoft 365 or similar, leave it exactly as it is. If you want SPF to align with your domain for DMARC, add the two optional Return-Path records below instead. They live on the `send.` subdomain and cannot collide with your existing SPF. ## DMARC record [#dmarc-record] Recommended. It tells inbox providers what to do with mail that fails authentication, and gives you reports on what is being sent in your name. | Type | Host / Name | Value | | ----- | ----------------- | --------------------------------------------- | | `TXT` | `_dmarc.acme.com` | `v=DMARC1; p=none; rua=mailto:dmarc@acme.com` | Start at `p=none`, which only collects reports and changes nothing about delivery. Move to `quarantine` and then `reject` once the reports show your legitimate mail is authenticating. ## Return-Path records (optional) [#return-path-records-optional] Both are optional. Your domain sends fine without them — it just uses our shared bounce address, which means DMARC passes on DKIM alone. Publish **both** and we switch your mail to a bounce address on your own domain. SPF then passes *and* aligns with your `From:` domain, so DMARC passes on both mechanisms instead of one, and delayed bounces come back to us per-domain so failed addresses are suppressed automatically. | Type | Host / Name | Value | Priority | | ----- | --------------- | ------------------------------------- | -------- | | `TXT` | `send.acme.com` | `v=spf1 include:_spf.eusend.dev ~all` | — | | `MX` | `send.acme.com` | `feedback.eusend.dev` | `10` | This SPF record is safe: it sits on the `send.` subdomain, which has no mail of its own, so it cannot conflict with the SPF record on your root domain. We detect these automatically — publish them and alignment switches on at the next verification, with no action in the dashboard. > [!NOTE] > DNS changes can take up to 48 hours to propagate, though they typically take under an hour. Once > records are live, call `POST /domains/:id/verify` to trigger verification. # Inbox placement URL: https://eusend.dev/docs/domains/inbox-placement Find out whether your email reaches the inbox or the spam folder, read the headers that explain why, and fix the usual causes. `delivered` means the receiving server accepted your email. It does not say whether it landed in the inbox or the spam folder — that decision happens after acceptance, inside the mailbox provider. This page shows how to test placement yourself and what to change when a message is filtered. ## Test with a real message [#test-with-a-real-message] ### Send to a few inboxes you own [#send-to-a-few-inboxes-you-own] One Gmail, one Outlook and one Yahoo address cover most recipients. Include at least one account that has **never received mail from your domain**. An inbox where you have already opened your messages or clicked "Not spam" has learned to trust you and will flatter the result. ### Send what your users will actually get [#send-what-your-users-will-actually-get] Use a real password reset, receipt or notification — not "hello world". Filters are trained on throwaway test messages, so a probe like this is far more likely to be filtered than your production mail: ```json title="likely spam" { "from": "Test ", "subject": "hello world!", "html": "

Just testing if this goes to spam.

" } ``` ```json title="representative" { "from": "Acme ", "subject": "Your support request #1042", "html": "

Hi Sam,

Thanks for getting in touch. We've received your request and will reply within one business day.

In the meantime, our setup guide covers the most common issues: acme.com/help.

— The Acme team

" } ``` ### Note the folder, then read the headers [#note-the-folder-then-read-the-headers] Check each inbox, then open the raw message: in Gmail, **⋮ → Show original**; in Outlook, **… → View → View message source**. ## Reading the headers [#reading-the-headers] Start with `Authentication-Results`. All three should pass: ```text Authentication-Results: mx.google.com; dkim=pass header.i=@acme.com; spf=pass smtp.mailfrom=bounce@eusend.dev; dmarc=pass header.from=acme.com ``` | Result | What it means | | --------------------------- | ------------------------------------------------------------------------------------------------------- | | `dkim=fail` or missing | The DKIM record is missing or changed. Re-check it under [Domains](/docs/domains). | | `spf=pass` but `dmarc=fail` | Neither DKIM nor SPF is aligned with your From domain — usually DKIM. See [DMARC](/docs/domains/dmarc). | | All pass | Authentication is fine. The filter is judging content or reputation, covered below. | Outlook adds its own verdict: | Header | Inbox | Junk | | -------------------------------- | ----------- | ------------- | | `X-MS-Exchange-Organization-SCL` | `-1` to `4` | `5` and above | | `X-Forefront-Antispam-Report` | `SFV:NSPM` | `SFV:SPM` | In Gmail, a message in Spam usually carries a grey banner explaining why — "similar to messages identified as spam" points at content, "the sender's reputation" points at your domain. ## Isolate the cause [#isolate-the-cause] When one message is filtered and another isn't, change **one thing at a time** — recipient, content or From address — and send again. Placement depends on all three, so comparing two messages that differ in several ways tells you nothing. > [!NOTE] > One message in spam is a data point, not a verdict. Look for a pattern across a few sends and > providers before changing anything. ## Common causes [#common-causes] | Cause | Fix | | ---------------------------------- | ------------------------------------------------------------------------------------------------------------------------- | | Test-looking content | Send real copy with a specific subject, a greeting and a few sentences. | | Generic sender | Use a recognisable display name and a real mailbox (`support@`, `billing@`), not `test@` or `noreply@test`. | | Mostly images or a single link | Keep a reasonable amount of text, and link to your own domain rather than URL shorteners. | | No plain-text part | eusend generates one from `html` when you don't pass `text`. Pass your own for full control. | | New domain or subdomain | Providers have no history for it yet. Start with low volume to engaged recipients and let it build. | | Marketing mixed with transactional | Send newsletters from a separate subdomain (`news.acme.com`), so complaints about them don't affect your password resets. | | Mail people didn't ask for | Only email people who expect it, and honour unsubscribes. Spam complaints weigh more than anything else on this page. | ## Track it over time [#track-it-over-time] A single test shows you one day. To watch your domain's reputation as it builds: * **[Google Postmaster Tools](https://postmaster.google.com)** shows your domain's reputation and spam-complaint rate at Gmail. Verify your sending domain there; data appears once you send roughly a hundred messages a day to Gmail users. * **[Open and click rates](/docs/tracking)** are the earliest warning. A sudden drop usually means mail is landing in spam, well before it shows up as bounces. * **[Bounces and complaints](/docs/emails/suppressions)** — eusend suppresses recipients who bounce or mark you as spam, so a growing suppression list is a signal to look at what you send and to whom. # DNS Providers URL: https://eusend.dev/docs/domains/registrars Step-by-step guides for publishing your eusend DNS records at the most common DNS providers, and the four mistakes that account for most failed verifications. The records eusend gives you are the same everywhere. What differs is what each control panel expects you to type into its fields — and getting that wrong is the reason most domains fail to verify. Pick your provider below, or read [the four traps](#the-four-traps) first if yours is not listed. - [**Cloudflare**](/docs/domains/registrars/cloudflare) — Free plan included. Splits long values for you. - [**Namecheap**](/docs/domains/registrars/namecheap) — Never put your domain in the Host field. - [**Amazon Route 53**](/docs/domains/registrars/route53) — Quote the DKIM value and split it yourself. - [**Squarespace Domains**](/docs/domains/registrars/squarespace) — Formerly Google Domains. Appends your domain. - [**Porkbun**](/docs/domains/registrars/porkbun) — Leave Host blank for the root domain. - [**OVHcloud**](/docs/domains/registrars/ovhcloud) — Trailing dot on the MX target, or it breaks. - [**Gandi**](/docs/domains/registrars/gandi) — Split the DKIM value into quoted strings. - [**IONOS**](/docs/domains/registrars/ionos) — One-click setup available. Selector only in Host name. ## Which guide do I need? [#which-guide-do-i-need] Not your registrar — your **DNS host**. If you bought the domain at Namecheap but moved it to Cloudflare's nameservers, the records go in Cloudflare and the Namecheap panel will do nothing. Ask your domain who is in charge: ```bash title="find your DNS host" dig +short NS acme.com ``` The answer names the provider whose guide you want. If it is a host with no guide here, the [four traps](#the-four-traps) cover everything you need — the field labels are the only thing that changes. > [!NOTE] > Some providers can publish the records for you. If yours supports [Domain > Connect](https://www.domainconnect.org/), the dashboard shows a **Set up automatically** button on > the domain page — one click, their consent screen, done. Nothing below is needed in that case. ## The four traps [#the-four-traps] ### 1. The Host field almost never wants your domain [#1-the-host-field-almost-never-wants-your-domain] Most panels append your domain to whatever you type. eusend shows you the full record name, `eusend._domainkey.acme.com`, because that is what has to exist in DNS — but pasting all of it into a field that appends gives you `eusend._domainkey.acme.com.acme.com`, which resolves to nothing. In those panels you enter `eusend._domainkey` and stop. Each guide below says exactly what its panel does. To check whether this is what went wrong: ```bash title="did the domain get doubled?" dig +short TXT eusend._domainkey.acme.com.acme.com ``` An answer here means the record exists at the wrong name. Edit the record and remove the domain from the Host field. ### 2. The root domain is spelled differently everywhere [#2-the-root-domain-is-spelled-differently-everywhere] `@`, blank, or the domain itself, depending on the panel. This only matters for DMARC if you are publishing it at the apex — the eusend records all sit on subdomains (`eusend._domainkey`, `_dmarc`, `send`), so you will usually not need it. ### 3. The DKIM value is longer than a single DNS string may be [#3-the-dkim-value-is-longer-than-a-single-dns-string-may-be] A single string in a TXT record may hold 255 characters. Your DKIM value is around 400, because a 2048-bit RSA public key is long. The record is therefore stored as two strings, and resolvers join them back together — this is normal DNS, not a workaround. Most panels do the splitting for you when you paste the value whole. Two in this list do not: **Route 53** and **Gandi** expect you to split it yourself and wrap each piece in double quotes. Their guides show how. If a panel rejects your value as too long, that is what it is asking for. Never shorten or truncate the key — DKIM breaks. ### 4. MX targets sometimes need a trailing dot [#4-mx-targets-sometimes-need-a-trailing-dot] The optional Return-Path MX record points at `feedback.eusend.dev`. Some panels — OVHcloud notably — append your own domain to any target that does not end in a dot, turning it into `feedback.eusend.dev.acme.com`. Where that is the case the guide says to type `feedback.eusend.dev.` with the dot. ## What you are publishing [#what-you-are-publishing] Only the first record is required. The full reasoning for each — including why there is deliberately **no SPF record on your root domain** — is in [DNS records](/docs/domains/dns-records). | Record | Type | Value | Required | | ---------------------------- | ----- | --------------------------------------------- | ----------- | | `eusend._domainkey.acme.com` | `TXT` | `v=DKIM1; k=rsa; p=…` | Yes | | `_dmarc.acme.com` | `TXT` | `v=DMARC1; p=none; rua=mailto:dmarc@acme.com` | Recommended | | `send.acme.com` | `TXT` | `v=spf1 include:_spf.eusend.dev ~all` | Optional | | `send.acme.com` | `MX` | `feedback.eusend.dev` (priority `10`) | Optional | ## After you save [#after-you-save] Publishing is all you have to do — eusend polls your DNS in the background and flips the domain to `verified` on its own. If you want to check the records yourself first: ```bash title="verify from your machine" dig +short TXT eusend._domainkey.acme.com dig +short TXT _dmarc.acme.com ``` > [!NOTE] > Propagation is usually minutes, but a provider may take up to 48 hours. If `dig` shows the record > and eusend still has not verified, hit **Verify** on the domain page to check again immediately. # Cloudflare URL: https://eusend.dev/docs/domains/registrars/cloudflare Publish your eusend DNS records in Cloudflare DNS — the Name field, the automatic quoting of long DKIM values, and the proxy setting you can ignore. Cloudflare is the most forgiving panel in this list: it strips your zone name from the Name field if you paste it, and it splits long TXT values for you. > [!NOTE] > This is your DNS host, not necessarily your registrar. If `dig +short NS acme.com` returns > `*.ns.cloudflare.com`, this is the right guide regardless of where you bought the domain. ## Add the records [#add-the-records] ### Open the DNS editor [#open-the-dns-editor] In the [Cloudflare dashboard](https://dash.cloudflare.com), select your account, then your domain, then **DNS** → **Records**. Click **Add record**. ### DKIM — required [#dkim--required] | Field | Value | | ----------- | ------------------------------------------------------- | | **Type** | `TXT` | | **Name** | `eusend._domainkey` | | **Content** | the full `v=DKIM1; k=rsa; p=…` value from the dashboard | | **TTL** | Auto | Click **Save**. ### DMARC — recommended [#dmarc--recommended] | Field | Value | | ----------- | --------------------------------------------- | | **Type** | `TXT` | | **Name** | `_dmarc` | | **Content** | `v=DMARC1; p=none; rua=mailto:dmarc@acme.com` | Use an address you actually read for `rua` — see [DMARC](/docs/domains/dmarc). ### Return-Path — optional, both or neither [#return-path--optional-both-or-neither] | Field | Value | | ----------- | ------------------------------------- | | **Type** | `TXT` | | **Name** | `send` | | **Content** | `v=spf1 include:_spf.eusend.dev ~all` | Then a second record: | Field | Value | | --------------- | --------------------- | | **Type** | `MX` | | **Name** | `send` | | **Mail server** | `feedback.eusend.dev` | | **Priority** | `10` | Publish both and eusend switches your mail to a bounce address on your own domain, so SPF passes and aligns. One without the other does nothing. ## Cloudflare specifics [#cloudflare-specifics] **The Name field.** Cloudflare appends your zone, so `eusend._domainkey` becomes `eusend._domainkey.acme.com`. It also recognises and removes your zone name if you paste the full record name, which makes Cloudflare the one panel here where copying the name straight out of the eusend dashboard is safe. The saved record is displayed with its full name either way — glance at it once to confirm it does not read `…acme.com.acme.com`. **Long DKIM values are split for you.** Save the value whole. Cloudflare stores it as two quoted strings and the record list will show it that way, with the quotes visible and a break somewhere in the middle of the key. That is correct and resolvers join it back together; do not try to repair it. Cloudflare also adds the double quotes itself if you save a value without them. **Proxy status does not apply.** Neither TXT nor MX records have a proxy toggle — the orange cloud only appears for A, AAAA and CNAME records. There is nothing to turn off. **Existing SPF at the apex.** Do not add one. If Cloudflare Email Routing is enabled on this domain it already manages MX and SPF records at the apex; the eusend records live on the `send` and `eusend._domainkey` subdomains and will not collide with them. ## Check it [#check-it] ```bash title="verify" dig +short TXT eusend._domainkey.acme.com ``` Cloudflare's nameservers usually answer within a minute of saving. Official documentation: [Manage DNS records](https://developers.cloudflare.com/dns/manage-dns-records/how-to/create-dns-records/). # Gandi URL: https://eusend.dev/docs/domains/registrars/gandi Publish your eusend DNS records in Gandi LiveDNS — splitting the DKIM value into quoted strings, and the text editor that makes it a one-liner. Gandi will not split your DKIM value for you. Its documentation is explicit: "a TXT record is limited to 255 characters per string. In order to insert a TXT record with more than 255 characters you will need to break your record into strings that are 255 characters or less each, then surround each of those sections in quotes." Your DKIM value is around 400 characters, so this applies to it. The fastest way to do it is Gandi's text editor. ## The quick way: the text editor [#the-quick-way-the-text-editor] ### Build the record line [#build-the-record-line] Paste your DKIM value into this: ```bash title="build the zone line" echo -n 'v=DKIM1; k=rsa; p=MIIBIjANBgkq…' \ | fold -w 255 | sed 's/.*/"&"/' | tr '\n' ' ' \ | sed 's/^/eusend._domainkey 300 IN TXT /' ``` It prints one line, ready to paste: ``` eusend._domainkey 300 IN TXT "v=DKIM1; k=rsa; p=MIIBIjANBgkq…" "…rest of the key…" ``` ### Paste it into the zone [#paste-it-into-the-zone] After logging in, click **Domain** in the left navigation, click your domain, and open the **DNS Records** tab. Click **Edit DNS Records** to edit the whole zone as text, add your line at the end, and save. While you are there, the other records are one line each: ``` _dmarc 300 IN TXT "v=DMARC1; p=none; rua=mailto:dmarc@acme.com" send 300 IN TXT "v=spf1 include:_spf.eusend.dev ~all" send 300 IN MX 10 feedback.eusend.dev. ``` The two `send` records are optional, but publish both or neither — one alone does nothing. Use an address you actually read for `rua`; see [DMARC](/docs/domains/dmarc). ## The form, if you prefer it [#the-form-if-you-prefer-it] Click **Add** above the record table and fill in the dialog: **Type** `TXT`, **Name** `eusend._domainkey`, **TTL** `300`, and the value. For the DKIM record the value must be the split, quoted form from the command above — pasted whole, it is over the 255-character string limit. Short values like DMARC need no quotes. Repeat for `_dmarc`, and for `send` if you are adding the Return-Path records. For the MX record, choose type `MX` and give the target as `feedback.eusend.dev.` with the trailing dot, priority `10`. ## Gandi specifics [#gandi-specifics] **The Name field takes the subdomain only.** `eusend._domainkey`, `_dmarc`, `send`. The root domain is `@` — Gandi's documentation: "Most of the time, you will want it to be associated with the bare domain, which is represented by the @ symbol." None of the eusend records need it. **300 seconds is the floor.** Gandi enforces a minimum TTL of 300 seconds on LiveDNS. Anything lower is rejected. **Quotes: only where they are needed.** Gandi asks for TXT values without quotation marks — the exception is the multi-string case above, where the quotes are what separates the strings. **LiveDNS only.** These instructions are for Gandi's LiveDNS nameservers (`ns-*.gandi.net`). If your domain points elsewhere, so do your records. ## Check it [#check-it] ```bash title="verify" dig +short TXT eusend._domainkey.acme.com ``` You will see the value printed as two quoted strings. That is correct — resolvers join them back together, and eusend parses either form. Official documentation: [How do I update my DNS records?](https://docs.gandi.net/en/domain_names/common_operations/dns_records.html) and [What are TXT records?](https://docs.gandi.net/en/domain_names/faq/record_types/txt_record.html) # IONOS URL: https://eusend.dev/docs/domains/registrars/ionos Publish your eusend DNS records at IONOS — the one-click path that skips the form entirely, and the Host name field that takes the selector only. IONOS is a Domain Connect provider, so you probably do not have to do any of this by hand. > [!NOTE] > **Try the automatic route first.** On the domain page in eusend, a **Set up automatically** button > appears when your DNS provider can publish the records for us — IONOS can. You are sent to IONOS, > you approve the change on their own screen, and you come back done. We never hold credentials for > your zone. The manual steps below are the fallback. ## Add the records [#add-the-records] ### Open DNS settings [#open-dns-settings] Log in to IONOS and go to **Domains & SSL**. For the domain you want, click the gear symbol under **Actions** and select **DNS**. Click **Add record** and choose the record type. ### DKIM — required [#dkim--required] | Field | Value | | ------------- | ------------------------------------------------------- | | **Type** | `TXT` | | **Host name** | `eusend._domainkey` | | **Value** | the full `v=DKIM1; k=rsa; p=…` value from the dashboard | | **TTL** | leave as-is | Click **Save**. ### DMARC — recommended [#dmarc--recommended] | Field | Value | | ------------- | --------------------------------------------- | | **Type** | `TXT` | | **Host name** | `_dmarc` | | **Value** | `v=DMARC1; p=none; rua=mailto:dmarc@acme.com` | Use an address you actually read for `rua` — see [DMARC](/docs/domains/dmarc). ### Return-Path — optional, both or neither [#return-path--optional-both-or-neither] | Field | Value | | ------------- | ------------------------------------- | | **Type** | `TXT` | | **Host name** | `send` | | **Value** | `v=spf1 include:_spf.eusend.dev ~all` | Then a second record: | Field | Value | | ------------- | --------------------- | | **Type** | `MX` | | **Host name** | `send` | | **Points to** | `feedback.eusend.dev` | | **Priority** | `10` | Publish both and eusend switches your mail to a bounce address on your own domain, so SPF passes and aligns. One without the other does nothing. ## IONOS specifics [#ionos-specifics] **The Host name field takes the selector only.** IONOS's own DKIM documentation uses `s1-ionos._domainkey` — the selector and `_domainkey`, with no domain after it. Yours is `eusend._domainkey`. The root domain is `@`, which none of the eusend records need. **If IONOS rejects the DKIM value as too long**, it is asking you to split it. A single DNS string holds 255 characters and your value is around 400, so break it into two quoted pieces on one line: ```bash title="split the DKIM value" echo -n 'v=DKIM1; k=rsa; p=MIIBIjANBgkq…' | fold -w 255 | sed 's/.*/"&"/' | tr '\n' ' ' ``` Paste the result — `"first piece" "second piece"` — into the Value field. Never shorten the key to make it fit; resolvers rejoin the pieces, but a truncated key breaks DKIM permanently. **Your IONOS mailboxes are unaffected.** If this domain receives mail through IONOS, leave the MX records at the apex exactly as they are. The eusend MX record sits on `send`, a subdomain with no mail of its own. **TTL is optional.** IONOS applies changes to its own nameservers immediately; there is no reason to set one for these records. **Only when IONOS runs your DNS.** If the domain's nameservers point elsewhere, so do your records — check with `dig +short NS acme.com`. ## Check it [#check-it] ```bash title="verify" dig +short TXT eusend._domainkey.acme.com ``` If that is empty, check whether the domain ended up in the Host name field: ```bash dig +short TXT eusend._domainkey.acme.com.acme.com ``` Official documentation: [Managing TXT records](https://www.ionos.com/help/domains/configuring-txt-and-srv-records/managing-txt-records/) and [Email authentication with DKIM](https://www.ionos.com/help/domains/configuring-mail-servers-and-other-related-records/email-authentication-with-dkim/). # Namecheap URL: https://eusend.dev/docs/domains/registrars/namecheap Publish your eusend DNS records in Namecheap's Advanced DNS — why the Host field must never contain your domain, and the Mail Settings switch that blocks MX records. Two things catch people out at Namecheap: the Host field silently appends your domain, and MX records live in a separate section that is switched off by default. > [!WARNING] > Namecheap's own documentation is explicit about the first one: "The domain name itself should not > be included in the Host field" — even if your provider showed you the full name. That is us. Enter > `eusend._domainkey`, not `eusend._domainkey.acme.com`. ## Add the records [#add-the-records] ### Open Advanced DNS [#open-advanced-dns] Sign in, click **Domain List** in the left sidebar, click **Manage** next to your domain, then open the **Advanced DNS** tab. ### DKIM — required [#dkim--required] Under **Host Records**, click **Add New Record**. | Field | Value | | --------- | ------------------------------------------------------- | | **Type** | `TXT Record` | | **Host** | `eusend._domainkey` | | **Value** | the full `v=DKIM1; k=rsa; p=…` value from the dashboard | | **TTL** | Automatic | Save with the green tick at the end of the row. ### DMARC — recommended [#dmarc--recommended] | Field | Value | | --------- | --------------------------------------------- | | **Type** | `TXT Record` | | **Host** | `_dmarc` | | **Value** | `v=DMARC1; p=none; rua=mailto:dmarc@acme.com` | Use an address you actually read for `rua` — see [DMARC](/docs/domains/dmarc). ### Return-Path SPF — optional [#return-path-spf--optional] | Field | Value | | --------- | ------------------------------------- | | **Type** | `TXT Record` | | **Host** | `send` | | **Value** | `v=spf1 include:_spf.eusend.dev ~all` | ### Return-Path MX — optional, pairs with the record above [#return-path-mx--optional-pairs-with-the-record-above] MX records are not in Host Records. Scroll down to **Mail Settings** and set the dropdown to **Custom MX** first — while it is on `Email Forwarding`, `Private Email` or `Gmail`, Namecheap manages the MX records itself and you cannot add your own. | Field | Value | | ------------ | --------------------- | | **Host** | `send` | | **Value** | `feedback.eusend.dev` | | **Priority** | `10` | Publish this and the SPF record above together, or neither — one alone does nothing. > [!WARNING] > Switching Mail Settings to **Custom MX** removes the MX records Namecheap was managing. If this > domain receives mail through Namecheap Private Email or email forwarding, note those MX records > first and re-enter them alongside the `send` record, or skip the two optional Return-Path records > entirely. Your domain sends fine without them. ## Namecheap specifics [#namecheap-specifics] **The Host field never takes your domain.** `eusend._domainkey`, `_dmarc`, `send` — that is all. Namecheap appends `acme.com` when it writes the record. **Only on Namecheap's nameservers.** The Advanced DNS tab edits records only if the domain uses `BasicDNS`, `PremiumDNS` or Namecheap's hosting nameservers. Check the **Nameservers** section on the Domain tab; if it says Custom DNS, your records belong wherever those nameservers point. **Propagation.** Namecheap's documentation gives around 30 minutes for a new record to become active — slower than most, so give it time before assuming something is wrong. ## Check it [#check-it] ```bash title="verify" dig +short TXT eusend._domainkey.acme.com ``` If that is empty, check for the doubled name before changing anything else: ```bash title="the classic Namecheap mistake" dig +short TXT eusend._domainkey.acme.com.acme.com ``` An answer there means the domain went into the Host field. Edit the record and remove it. Official documentation: [How do I add TXT/SPF/DKIM/DMARC records for my domain?](https://www.namecheap.com/support/knowledgebase/article.aspx/317/2237/how-do-i-add-txtspfdkimdmarc-records-for-my-domain/) and [How can I set up MX records?](https://www.namecheap.com/support/knowledgebase/article.aspx/322/2237/how-can-i-set-up-mx-records-required-for-mail-service/) # OVHcloud URL: https://eusend.dev/docs/domains/registrars/ovhcloud Publish your eusend DNS records in an OVHcloud DNS zone — the trailing dot that decides whether your MX record works, and the record types to avoid picking. OVHcloud has one rule that matters more than anything else here: a target without a trailing dot gets your own domain appended to it. ## Add the records [#add-the-records] ### Open the DNS zone [#open-the-dns-zone] In the OVHcloud Control Panel, go to **Web Cloud** → **Domain names**, select your domain, and open the **DNS zone** tab. Click **Add an entry** above the table. ### DKIM — required [#dkim--required] Choose **TXT** as the entry type. | Field | Value | | ------------- | ------------------------------------------------------- | | **Subdomain** | `eusend._domainkey` | | **TTL** | By default | | **Value** | the full `v=DKIM1; k=rsa; p=…` value from the dashboard | Click **Next**, then **Confirm**. > [!NOTE] > OVH's type list also offers dedicated **DKIM** and **SPF** entries, which build the record from > separate fields instead of one value. Plain **TXT** is what these instructions assume and is the > simpler path — you already have the finished value. ### DMARC — recommended [#dmarc--recommended] | Field | Value | | ------------- | --------------------------------------------- | | **Type** | `TXT` | | **Subdomain** | `_dmarc` | | **Value** | `v=DMARC1; p=none; rua=mailto:dmarc@acme.com` | Use an address you actually read for `rua` — see [DMARC](/docs/domains/dmarc). ### Return-Path — optional, both or neither [#return-path--optional-both-or-neither] | Field | Value | | ------------- | ------------------------------------- | | **Type** | `TXT` | | **Subdomain** | `send` | | **Value** | `v=spf1 include:_spf.eusend.dev ~all` | Then the MX record — and mind the dot: | Field | Value | | ------------- | ---------------------- | | **Type** | `MX` | | **Subdomain** | `send` | | **Priority** | `10` | | **Target** | `feedback.eusend.dev.` | Publish both and eusend switches your mail to a bounce address on your own domain, so SPF passes and aligns. One without the other does nothing. ## OVHcloud specifics [#ovhcloud-specifics] > [!WARNING] > **The trailing dot on the MX target is not optional.** OVH's documentation: when the target is a > domain, "punctuate it. Otherwise, your domain name gets appended to the target." Enter > `feedback.eusend.dev` without the final dot and OVH stores `feedback.eusend.dev.acme.com`, which > does not exist — bounces then go nowhere and SPF alignment never switches on. **The Subdomain field takes the subdomain only.** `eusend._domainkey`, `_dmarc`, `send`. Leave it empty for the root domain. OVH adds your domain when it writes the record, the same way it does to an unpunctuated target. **TTL.** Leave it on **By default**, or pick **Customised** and set a value in seconds. There is no reason to change it for these records. **Never use "Reset the DNS zone".** The button sits near the zone editor and restores OVH's default records, deleting everything you added — including your DKIM record. If you are trying to fix one bad record, edit that row instead: open the `⋮` menu on it and choose **Edit the entry**. **Only when the domain uses OVH's nameservers.** If the **Server** tab shows nameservers elsewhere, the DNS zone tab here is not what the internet reads. **Propagation.** OVH's own documentation allows up to 24 hours. In practice it is much faster, but it is the slowest provider in this list to promise anything. ## Check it [#check-it] ```bash title="verify" dig +short TXT eusend._domainkey.acme.com dig +short MX send.acme.com ``` The second command should print `10 feedback.eusend.dev.` — if it prints `feedback.eusend.dev.acme.com.`, the trailing dot is missing from the target. Official documentation: [Editing an OVHcloud DNS zone](https://docs.ovhcloud.com/en/guides/web-cloud/domains/dns-zone-edit) and [How to add a DNS TXT record](https://docs.ovhcloud.com/en/guides/web-cloud/domains/dns-zone-txt-record-creation). # Porkbun URL: https://eusend.dev/docs/domains/registrars/porkbun Publish your eusend DNS records at Porkbun — the Host field, the Answer field, and the 600-second TTL floor. Porkbun's DNS editor is one of the plainer ones. The only thing to remember is that the target field is called **Answer**, and that the root domain is an empty Host field rather than `@`. ## Add the records [#add-the-records] ### Open the DNS editor [#open-the-dns-editor] Sign in and go to **Domain Management**. Find your domain and click its **DNS** button — or open **Details** and choose the edit icon next to **DNS Records**. Click **Add Record**. ### DKIM — required [#dkim--required] | Field | Value | | ---------- | ------------------------------------------------------- | | **Type** | `TXT - Text record` | | **Host** | `eusend._domainkey` | | **Answer** | the full `v=DKIM1; k=rsa; p=…` value from the dashboard | | **TTL** | `600` | Click **Add**. ### DMARC — recommended [#dmarc--recommended] | Field | Value | | ---------- | --------------------------------------------- | | **Type** | `TXT - Text record` | | **Host** | `_dmarc` | | **Answer** | `v=DMARC1; p=none; rua=mailto:dmarc@acme.com` | Use an address you actually read for `rua` — see [DMARC](/docs/domains/dmarc). ### Return-Path — optional, both or neither [#return-path--optional-both-or-neither] | Field | Value | | ---------- | ------------------------------------- | | **Type** | `TXT - Text record` | | **Host** | `send` | | **Answer** | `v=spf1 include:_spf.eusend.dev ~all` | Then a second record. The **Priority** field only appears once you choose MX: | Field | Value | | ------------ | --------------------- | | **Type** | `MX - Mail exchange` | | **Host** | `send` | | **Answer** | `feedback.eusend.dev` | | **Priority** | `10` | Publish both and eusend switches your mail to a bounce address on your own domain, so SPF passes and aligns. One without the other does nothing. ## Porkbun specifics [#porkbun-specifics] **Host takes the subdomain only.** Porkbun's documentation: for the root domain "you will leave this field blank" — not `@` — and for a subdomain "this is where you will enter that subdomain name". So `eusend._domainkey`, `_dmarc`, `send`, with no `.acme.com`. **600 seconds is the floor.** Porkbun's minimum and default TTL is 600 seconds. You cannot go lower, and there is no reason to. **Porkbun's own email records.** If you use Porkbun's email forwarding or hosted email, leave the MX records at the apex exactly as they are. The eusend MX record sits on `send`, which has no mail of its own, so the two never interact. **The Notes field is yours.** It is local metadata, never published. Writing `eusend DKIM` in it makes the record list readable a year from now. ## Check it [#check-it] ```bash title="verify" dig +short TXT eusend._domainkey.acme.com ``` Official documentation: [How to add DNS records on Porkbun](https://kb.porkbun.com/article/231-how-to-add-dns-records-on-porkbun). # Amazon Route 53 URL: https://eusend.dev/docs/domains/registrars/route53 Publish your eusend DNS records in Route 53 — quoting and splitting the DKIM value, the MX priority format, and the duplicate hosted zone that quietly breaks everything. Route 53 is stricter than every other panel in this list about how a TXT value is written. It will not split your DKIM key for you, and it will not add the quotes. ## Split the DKIM value first [#split-the-dkim-value-first] A single DNS string holds 255 characters; your DKIM value is around 400. Route 53 requires you to break it into pieces yourself, wrap each in double quotes, and put them on one line separated by spaces. Its own limit is 4,000 characters in total, so two pieces is always enough. Paste your value into this to get the exact string Route 53 wants: ```bash title="split the DKIM value" echo -n 'v=DKIM1; k=rsa; p=MIIBIjANBgkq…' | fold -w 255 | sed 's/.*/"&"/' | tr '\n' ' ' ``` The result looks like this, and goes into the value box as-is: ``` "v=DKIM1; k=rsa; p=MIIBIjANBgkq…" "…rest of the key…" ``` Never shorten the key to fit. Splitting changes nothing about the record — a resolver joins the strings back together — but a truncated key breaks DKIM. ## Add the records [#add-the-records] ### Open the hosted zone [#open-the-hosted-zone] In the [Route 53 console](https://console.aws.amazon.com/route53/), choose **Hosted zones** in the navigation pane, then the name of your zone. Choose **Create record**. If the console asks for a routing policy, choose **Simple routing**. ### DKIM — required [#dkim--required] | Field | Value | | --------------- | ---------------------------------- | | **Record name** | `eusend._domainkey` | | **Record type** | `TXT` | | **Value** | the quoted, split value from above | | **TTL** | `300` | The **Record name** box shows `.acme.com` beside it — that suffix is added for you, so type only `eusend._domainkey`. ### DMARC — recommended [#dmarc--recommended] | Field | Value | | --------------- | ----------------------------------------------- | | **Record name** | `_dmarc` | | **Record type** | `TXT` | | **Value** | `"v=DMARC1; p=none; rua=mailto:dmarc@acme.com"` | Short enough for one string, but the quotes are still required. Use an address you actually read for `rua` — see [DMARC](/docs/domains/dmarc). ### Return-Path — optional, both or neither [#return-path--optional-both-or-neither] | Field | Value | | --------------- | --------------------------------------- | | **Record name** | `send` | | **Record type** | `TXT` | | **Value** | `"v=spf1 include:_spf.eusend.dev ~all"` | Then a second record. Route 53 has no separate priority field — the priority and the mail server go in one value, separated by a space: | Field | Value | | --------------- | ------------------------ | | **Record name** | `send` | | **Record type** | `MX` | | **Value** | `10 feedback.eusend.dev` | Publish both and eusend switches your mail to a bounce address on your own domain, so SPF passes and aligns. One without the other does nothing. ## Route 53 specifics [#route-53-specifics] **Everything in a TXT value is quoted.** Route 53 rejects unquoted values, and a value that saved without quotes is not the value you think it is. This applies to the short records too. **To enter two separate TXT records at the same name**, put each value on its own line in the same record — not in two records. Route 53 treats one name plus one type as a single record with multiple values. **The zone apex has an empty name.** Not `@`. AWS is explicit: "If you're creating a record that has the same name as the hosted zone, don't enter a value (for example, an @ symbol) in the Name field." None of the eusend records sit at the apex, so this only comes up if you publish DMARC there. > [!WARNING] > **Check you are editing the live hosted zone.** Route 53 lets you keep several hosted zones for > the same domain name, each with its own nameservers, and only one of them is authoritative. > Records added to the wrong one are invisible to the internet and to us. Compare the NS values in > the zone against `dig +short NS acme.com` before you start — this is the single most common reason > a correct-looking Route 53 record never verifies. **Registered elsewhere?** If the domain is registered outside AWS, its nameservers at that registrar must point at this hosted zone's four NS values. Creating the zone does not do that for you. ## Check it [#check-it] ```bash title="verify" dig +short TXT eusend._domainkey.acme.com ``` Route 53 propagates to its own nameservers within about 60 seconds of saving. Official documentation: [Creating records by using the console](https://docs.aws.amazon.com/Route53/latest/DeveloperGuide/resource-record-sets-creating.html) and [TXT record type](https://docs.aws.amazon.com/Route53/latest/DeveloperGuide/ResourceRecordTypes.html#TXTFormat). # Squarespace Domains URL: https://eusend.dev/docs/domains/registrars/squarespace Publish your eusend DNS records at Squarespace Domains — formerly Google Domains. The Name field appends your domain, and the default TTL is four hours. Squarespace took over Google Domains, so domains bought from Google are managed here now. The panel appends your domain to the Name field, and its default TTL is unusually long. > [!NOTE] > You can only edit DNS here if the domain is registered with Squarespace or connected through > Nameserver Connect. If it is pointed somewhere else, the records belong at that provider — check > with `dig +short NS acme.com`. ## Add the records [#add-the-records] ### Open DNS settings [#open-dns-settings] Open the [domains dashboard](https://account.squarespace.com/domains), click your domain, then **DNS** → **DNS Settings**. Scroll to **Custom Records** and click **Add record**. You will be asked for your password or a 2FA code before the record saves. ### DKIM — required [#dkim--required] | Field | Value | | -------- | ------------------------------------------------------- | | **Type** | `TXT` | | **Name** | `eusend._domainkey` | | **Text** | the full `v=DKIM1; k=rsa; p=…` value from the dashboard | Click **Save**. ### DMARC — recommended [#dmarc--recommended] | Field | Value | | -------- | --------------------------------------------- | | **Type** | `TXT` | | **Name** | `_dmarc` | | **Text** | `v=DMARC1; p=none; rua=mailto:dmarc@acme.com` | Use an address you actually read for `rua` — see [DMARC](/docs/domains/dmarc). ### Return-Path — optional, both or neither [#return-path--optional-both-or-neither] | Field | Value | | -------- | ------------------------------------- | | **Type** | `TXT` | | **Name** | `send` | | **Text** | `v=spf1 include:_spf.eusend.dev ~all` | Then a second record: | Field | Value | | --------------- | --------------------- | | **Type** | `MX` | | **Name** | `send` | | **Priority** | `10` | | **Mail Server** | `feedback.eusend.dev` | Publish both and eusend switches your mail to a bounce address on your own domain, so SPF passes and aligns. One without the other does nothing. ## Squarespace specifics [#squarespace-specifics] **The Name field appends your domain.** Squarespace's documentation puts it plainly: "Squarespace automatically adds your domain to the Name field. This means if your provider asks you add your domain to the Name field, like yourdomain.com, you'll enter **@**." So `eusend._domainkey`, `_dmarc` and `send` — never with `.acme.com` on the end. **The default TTL is four hours.** Every custom record gets 14400 seconds unless you change it. That is fine for records you are publishing once, but it means a *correction* takes up to four hours to be seen. If you expect to fix a typo, set a shorter TTL on the way in. **Email presets can overwrite things.** Squarespace offers one-click presets for Google Workspace and other mail providers that write a batch of MX and TXT records. Applying one after you have added the eusend records can replace records at the same names — add the presets first, then the eusend records. ## Check it [#check-it] ```bash title="verify" dig +short TXT eusend._domainkey.acme.com ``` If it is empty, check whether the domain was appended twice: ```bash dig +short TXT eusend._domainkey.acme.com.acme.com ``` Official documentation: [Adding TXT records](https://support.squarespace.com/hc/en-us/articles/31120980444429-Adding-TXT-records) and [DNS records for email](https://support.squarespace.com/hc/en-us/articles/31120985010957-DNS-records-for-email). # Batch Send URL: https://eusend.dev/docs/emails/batch Send up to 100 emails in a single request. Each email is independent — failures are per-email. `POST /emails/batch` ## Request body [#request-body] An array of up to 100 email objects. Each object has the same schema as [POST /emails](/docs/emails/send), except that `attachments` and `scheduled_at` are not supported here — send or schedule those individually via `POST /emails`. ```bash title="request" curl -X POST https://api.eusend.dev/emails/batch \ -H "Authorization: Bearer eu_live_xxxxxxxxxxxx" \ -H "Content-Type: application/json" \ -d '[ { "from": "noreply@acme.com", "to": "alice@example.com", "subject": "Receipt #1001", "html": "

Thanks, Alice!

", "tags": { "category": "receipt" } }, { "from": "noreply@acme.com", "to": "bob@example.com", "subject": "Receipt #1002", "html": "

Thanks, Bob!

" } ]' ``` ## Response [#response] One result per input email, in the same order: `data[i]` describes `emails[i]`. A queued email carries its `id`; an email that could not be queued carries `error` and `code` instead (for example an unverified sender domain, all recipients suppressed, or an exhausted quota). Failed items never fail the rest of the batch — retry just those. ```json title="response — 201 Created" { "data": [ { "id": "9a8b7c6d-5e4f-4a3b-8c1d-0e9f8a7b6c5d" }, { "error": "All recipients are suppressed", "code": "ALL_SUPPRESSED" } ] } ``` > [!WARNING] > Batch sends count toward your daily and monthly limits. A batch of 50 emails uses 50 of your > quota. ## Idempotency [#idempotency] Pass an `Idempotency-Key` header to make a retried batch safe. Each item is tracked under the key and its position, so resending the same batch returns the ids of the emails that were already queued — without sending them again — and processes only the items that failed or never ran. Keep the items in the same order when you retry. A batch whose items were all queued before answers `200 OK` with the original ids. Keys must be at most 255 characters and contain no control characters; invalid keys return `400 VALIDATION_ERROR`. Batch keys are separate from single-send keys, and test and live sends use separate key spaces. Retries matching older batch keys can return `409 CONFLICT` because the old keys cannot always be distinguished from single-send keys. No items are queued when this happens. Check the original emails' statuses before deciding whether to use a new key, since a new key may send duplicate emails. # Email Details URL: https://eusend.dev/docs/emails/details Get a single email and its full event history — opens, clicks, delivery, bounces. `GET /emails/:id` ```bash title="request" curl "https://api.eusend.dev/emails/9a8b7c6d-5e4f-4a3b-8c1d-0e9f8a7b6c5d" \ -H "Authorization: Bearer eu_live_xxxxxxxxxxxx" ``` ```json title="response — 200 OK" { "id": "9a8b7c6d-5e4f-4a3b-8c1d-0e9f8a7b6c5d", "from": "noreply@acme.com", "to": ["alice@example.com"], "subject": "Your order has shipped", "status": "delivered", "tags": { "category": "shipping_update" }, "scheduledAt": null, "createdAt": "2026-05-20T10:00:00.000Z", "events": [ { "type": "sent", "createdAt": "2026-05-20T10:00:01.000Z" }, { "type": "delivered", "createdAt": "2026-05-20T10:00:03.000Z" }, { "type": "opened", "createdAt": "2026-05-20T10:05:12.000Z" }, { "type": "clicked", "createdAt": "2026-05-20T10:05:30.000Z" } ] } ``` # List Emails URL: https://eusend.dev/docs/emails/list Retrieve a paginated list of emails sent from your organization. `GET /emails` ## Query parameters [#query-parameters] | Parameter | Type | Description | | --- | --- | --- | | `status` | `string` | Filter by status: queued, scheduled, canceled, sending, sent, delivered, bounced, complained, suppressed, failed. | | `from` | `string` | Filter by sender email address. | | `to` | `string` | Filter by recipient email address. | | `tag` | `string` | Filter by tag. "category:password_reset" matches that exact pair; a bare "category" matches any email carrying the tag. Repeat the parameter to require several. See Tags. | | `cursor` | `string (UUID)` | Pagination cursor — pass next_cursor from the previous response. | | `limit` | `number` | Results per page. Default: 10. Max: 100. | ```bash title="request" curl "https://api.eusend.dev/emails?status=delivered&limit=10" \ -H "Authorization: Bearer eu_live_xxxxxxxxxxxx" ``` ```json title="response — 200 OK" { "data": [ { "id": "9a8b7c6d-5e4f-4a3b-8c1d-0e9f8a7b6c5d", "from": "noreply@acme.com", "to": ["alice@example.com"], "subject": "Your order has shipped", "status": "delivered", "tags": { "category": "shipping_update" }, "testMode": false, "createdAt": "2026-05-20T10:00:00.000Z" } ], "next_cursor": "9a8b7c6d-5e4f-4a3b-8c1d-0e9f8a7b6c5d" } ``` # Scheduling URL: https://eusend.dev/docs/emails/scheduling Schedule a transactional email up to 30 days ahead, then reschedule or cancel it before it sends. Schedule a transactional email up to 30 days ahead by passing `scheduled_at` to [POST /emails](/docs/emails/send). Until it sends, the email sits in status `scheduled` and can be rescheduled or canceled. ## Schedule a send [#schedule-a-send] `scheduled_at` accepts an ISO 8601 timestamp or a natural-language time like `"in 1 hour"` or `"tomorrow at 9am"`, parsed server-side (relative phrasings resolve in UTC). It must resolve to a time in the future and at most 30 days out. All send checks — domain verification, suppression, and your daily and monthly limits — run at schedule time, and the send is debited from your monthly quota immediately (canceling refunds it). Recipients who get suppressed between scheduling and the send time are still dropped at send time. ```bash title="request" curl -X POST https://api.eusend.dev/emails \ -H "Authorization: Bearer eu_live_xxxxxxxxxxxx" \ -H "Content-Type: application/json" \ -d '{ "from": "noreply@acme.com", "to": "alice@example.com", "subject": "Your trial ends tomorrow", "html": "

Reminder: your trial ends in 24 hours.

", "scheduled_at": "2026-07-03T09:00:00Z" }' ``` ```json title="response — 201 Created" { "id": "9a8b7c6d-5e4f-4a3b-8c1d-0e9f8a7b6c5d" } ``` ## Reschedule [#reschedule] `PATCH /emails/:id` Move a scheduled email to a new time. Only emails still in status `scheduled` can be rescheduled — once sending has started this returns `409 CONFLICT`. Moving it onto another day counts against that day's sending limit; if the new day is already full this returns `429 DAILY_LIMIT_EXCEEDED` and the email keeps its original time. | Parameter | Type | Description | | --- | --- | --- | | `scheduled_at` (required) | `string (ISO 8601 or natural language)` | The new send time — an ISO 8601 timestamp or natural language like "in 1 hour" (parsed server-side). Must resolve to the future, at most 30 days out. | ```bash title="request" curl -X PATCH https://api.eusend.dev/emails/9a8b7c6d-5e4f-4a3b-8c1d-0e9f8a7b6c5d \ -H "Authorization: Bearer eu_live_xxxxxxxxxxxx" \ -H "Content-Type: application/json" \ -d '{ "scheduled_at": "2026-07-04T09:00:00Z" }' ``` ```json title="response — 200 OK" { "id": "9a8b7c6d-5e4f-4a3b-8c1d-0e9f8a7b6c5d", "status": "scheduled", "scheduled_at": "2026-07-04T09:00:00.000Z" } ``` ## Cancel [#cancel] `POST /emails/:id/cancel` Cancel a scheduled email before it sends. The email moves to the terminal status `canceled` and the send is refunded to your monthly quota. Like reschedule, this returns `409 CONFLICT` once sending has started. ```bash title="request" curl -X POST https://api.eusend.dev/emails/9a8b7c6d-5e4f-4a3b-8c1d-0e9f8a7b6c5d/cancel \ -H "Authorization: Bearer eu_live_xxxxxxxxxxxx" ``` ```json title="response — 200 OK" { "id": "9a8b7c6d-5e4f-4a3b-8c1d-0e9f8a7b6c5d", "status": "canceled" } ``` > [!NOTE] > Scheduling is per-email and not available on the batch endpoint. For scheduling a campaign to an > audience, use [Broadcasts](/docs/broadcasts) — they have their own `scheduled_at`. # Send an Email URL: https://eusend.dev/docs/emails/send Send a single transactional email. Returns immediately with an email ID; delivery is asynchronous. `POST /emails` ## Request body [#request-body] | Parameter | Type | Description | | --- | --- | --- | | `from` (required) | `string` | Sender address. Accepts a bare email or a display name, e.g. "Acme ". Must be from a verified domain. | | `to` (required) | `string \| string[]` | Recipient email address(es). Maximum 50. | | `subject` | `string` | Email subject line. Required unless using a template that defines one. | | `html` | `string` | HTML body of the email. Up to 2,000,000 characters. | | `text` | `string` | Plain-text body. Used as fallback when HTML is not supported. Generated from `html` when omitted. | | `template_id` | `string (UUID)` | ID of a saved template. The template supplies the HTML body — an html you pass alongside it is ignored — and its subject, unless you pass a subject of your own. A text part you pass is still used. | | `variables` | `object` | Template variables to interpolate. Used with template_id. | | `cc` | `string \| string[]` | CC recipients. Maximum 50. | | `bcc` | `string \| string[]` | BCC recipients. Maximum 50. | | `reply_to` | `string \| string[]` | Reply-To address(es). Maximum 50. | | `headers` | `object` | Custom email headers as key-value pairs, up to 50. Headers eusend writes itself are refused with a 400: From, Sender, To, Cc, Bcc, Reply-To, Subject, Date, Message-ID, Return-Path, Received, DKIM-Signature, Authentication-Results, MIME-Version, Content-Type, Content-Transfer-Encoding, and anything starting with X-Eusend- or ARC-. Use the matching request field instead where there is one. | | `tags` | `object \| object[]` | Labels for filtering your email log and routing webhook events, e.g. {"category": "password_reset"}. The [{ "name": ..., "value": ... }] array form is accepted too. Up to 10 tags; names and values may contain ASCII letters, numbers, underscores and dashes. See Tags. | | `track_opens` | `boolean` | Open tracking via a 1×1 pixel. Omit to use your organization default (off unless changed under Settings → General → Email tracking); set true to track this send, false to opt it out. | | `track_clicks` | `boolean` | Click tracking by rewriting links through eusend. Omit to use your organization default (off unless changed); set true to track this send, false to opt it out. Rewritten links can hurt inbox placement. | | `attachments` | `object[]` | File attachments. Up to 20 per message, 10 MB combined. Each item: filename (string) plus exactly one of content (base64-encoded file bytes) or path (a public URL we fetch at send time), optional content_type (inferred from the filename or the fetched response when omitted), and optional content_id to embed the file inline via cid:. | | `scheduled_at` | `string (ISO 8601 or natural language)` | Schedule the send for a future time, at most 30 days out. Accepts an ISO 8601 timestamp or a natural-language time like "in 1 hour" or "tomorrow at 9am" (parsed server-side). The email is created with status "scheduled" and sends at that time. Reschedule with PATCH /emails/:id or cancel with POST /emails/:id/cancel — see Scheduling. | > [!NOTE] > At least one of > > `html` > > , > > `text` > > , or > > `template_id` > > is required. ## Example — plain HTML [#example--plain-html] ```bash title="request" curl -X POST https://api.eusend.dev/emails \ -H "Authorization: Bearer eu_live_xxxxxxxxxxxx" \ -H "Content-Type: application/json" \ -d '{ "from": "noreply@acme.com", "to": ["alice@example.com", "bob@example.com"], "subject": "Your order has shipped", "html": "

Your order #1234 is on its way!

", "text": "Your order #1234 is on its way!", "track_opens": true, "track_clicks": true }' ``` ```json title="response — 201 Created" { "id": "9a8b7c6d-5e4f-4a3b-8c1d-0e9f8a7b6c5d" } ``` ## Example — with an attachment [#example--with-an-attachment] Attach a file by passing its bytes base64-encoded as `content`, or point `path` at a public URL and we fetch it at send time. Set `content_id` to embed an image inline and reference it from your HTML with ``. ```bash title="request" curl -X POST https://api.eusend.dev/emails \ -H "Authorization: Bearer eu_live_xxxxxxxxxxxx" \ -H "Content-Type: application/json" \ -d '{ "from": "billing@acme.com", "to": "alice@example.com", "subject": "Your invoice", "html": "

Thanks! Your invoice is attached.

", "attachments": [ { "filename": "invoice.pdf", "content": "JVBERi0xLjQKJ...base64...", "content_type": "application/pdf" }, { "filename": "logo.png", "path": "https://cdn.acme.com/logo.png" } ] }' ``` ## Idempotency [#idempotency] Pass an `Idempotency-Key` request header to make retries safe. If a request with the same key has already been accepted for your organisation, the original email ID is returned immediately and no second send is queued — regardless of how many times you retry. Test and live sends use separate key spaces, as do single and batch sends. Keep the key and request body unchanged when retrying. Keys longer than 255 characters or containing control characters are rejected with `400 VALIDATION_ERROR`, rather than truncated. An ambiguous older key can return `409 CONFLICT`, including older single-send keys ending in `#` followed by a number. No new email is queued in that case. Check the existing email's status before deciding whether to use a new key, because a new key may send a second email. | Parameter | Type | Description | | --- | --- | --- | | `Idempotency-Key` | `string (header)` | Any unique string up to 255 characters. A UUID per send is a good default. Omit the header to skip idempotency checks. | ```bash title="request" curl -X POST https://api.eusend.dev/emails \ -H "Authorization: Bearer eu_live_xxxxxxxxxxxx" \ -H "Idempotency-Key: a4f3c2b1-dead-beef-0000-000000000001" \ -H "Content-Type: application/json" \ -d '{ "from": "noreply@acme.com", "to": "alice@example.com", "subject": "Your receipt", "html": "

Thanks for your order!

" }' ``` > [!NOTE] > A duplicate key returns `HTTP 200` with the original email ID. The first successful send always > returns `HTTP 201`. ## Example — with a template [#example--with-a-template] ```bash title="request" curl -X POST https://api.eusend.dev/emails \ -H "Authorization: Bearer eu_live_xxxxxxxxxxxx" \ -H "Content-Type: application/json" \ -d '{ "from": "noreply@acme.com", "to": "alice@example.com", "template_id": "550e8400-e29b-41d4-a716-446655440000", "variables": { "first_name": "Alice", "order_id": "1234", "tracking_url": "https://track.example.com/1234" } }' ``` # Statuses URL: https://eusend.dev/docs/emails/statuses Every email moves through a lifecycle of statuses as it's processed and delivered. Every email moves through a lifecycle of statuses as it's processed and delivered. | Status | Meaning | | ------------ | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `queued` | Email has been accepted and is waiting to be processed by the send worker. | | `scheduled` | Email was created with `scheduled_at` and is waiting for its send time. It can still be rescheduled or canceled. | | `canceled` | A scheduled email was canceled before its send time. Terminal — it will not send, and the send is refunded to your monthly quota. | | `sending` | Email is being handed to the mail server for delivery. | | `sent` | The mail server accepted the message and it is en route to the recipient. | | `delivered` | Delivery confirmed. | | `bounced` | Email hard-bounced — the receiving server permanently rejected it (e.g. invalid address). The address is automatically suppressed. Transient (soft) failures are retried and do not set this status. | | `complained` | Recipient reported the email as spam. Address is automatically suppressed. | | `suppressed` | The recipient address is on the [suppression list](/docs/emails/suppressions) — email was not sent. | | `failed` | Unrecoverable send failure after all retry attempts. | # Suppressions URL: https://eusend.dev/docs/emails/suppressions The addresses your organization will not send to — read, add, import, export, and remove them. Every organization has a suppression list: addresses we refuse to send to. A send to a suppressed address is skipped silently and the email is recorded with status `suppressed`; if every recipient of a send is suppressed, the request fails with `ALL_SUPPRESSED`. Addresses land on the list two ways: | Reason | Added by | | ----------- | ---------------------------------------------------------------------------------- | | `bounce` | Automatically, on a hard bounce (a permanent rejection from the receiving server). | | `complaint` | Automatically, when a recipient reports the message as spam. | | `manual` | By you, via the API or the [dashboard](https://eusend.dev/emails/suppressions). | The list is per-organization and applies across every API key and sending domain you own. It is never shared between organizations. > [!WARNING] > Removing an address that hard-bounced or complained lets you mail it again. Doing that repeatedly > is what damages a sender's reputation — remove an entry when you know the address was fixed or the > complaint was a mistake, not to retry a list that is failing. Suppression applies to live sending only. Test-mode API keys can read the list but cannot modify it. ## List suppressions [#list-suppressions] `GET /suppressions` | Parameter | Type | Description | | --- | --- | --- | | `email` | `string` | Filter to addresses containing this substring. Pass a domain ("@acme.com") to see every suppressed address there. | | `reason` | `string` | Filter by reason: bounce, complaint, or manual. | | `cursor` | `string (UUID)` | Pagination cursor — pass next_cursor from the previous response. | | `limit` | `number` | Results per page. Default: 50. Max: 100. | ```bash title="request" curl "https://api.eusend.dev/suppressions?reason=bounce&limit=50" \ -H "Authorization: Bearer eu_live_xxxxxxxxxxxx" ``` ```json title="response — 200 OK" { "data": [ { "id": "9a8b7c6d-5e4f-4a3b-8c1d-0e9f8a7b6c5d", "email": "invalid@example.com", "reason": "bounce", "created_at": "2026-05-20T10:00:00.000Z" } ], "next_cursor": null } ``` ## Add an address [#add-an-address] `POST /suppressions` | Parameter | Type | Description | | --- | --- | --- | | `email` (required) | `string` | The address to suppress. | | `reason` | `string` | bounce, complaint, or manual. Defaults to manual. | ```bash title="request" curl -X POST https://api.eusend.dev/suppressions \ -H "Authorization: Bearer eu_live_xxxxxxxxxxxx" \ -H "Content-Type: application/json" \ -d '{ "email": "opted-out@example.com" }' ``` Returns `201` with the new entry. If the address is already suppressed the call returns `200` with the **existing** entry — an add never overwrites the reason an address was suppressed for, so a manual add cannot mask a real bounce. ## Import a list [#import-a-list] `POST /suppressions/batch` Up to 1000 addresses per call. Items may be bare strings or objects, so a column lifted straight out of a CSV works as-is. > [!NOTE] > Addresses you add by hand — single adds and imports together — are capped at 100,000 per > organization; past it the call returns `403` with code `PLAN_LIMIT_EXCEEDED`. Bounces and > complaints are never refused, so the list always keeps recording addresses we must not mail again. > Email `support@eusend.dev` if you genuinely need a larger manual list. ```bash title="request" curl -X POST https://api.eusend.dev/suppressions/batch \ -H "Authorization: Bearer eu_live_xxxxxxxxxxxx" \ -H "Content-Type: application/json" \ -d '{ "emails": [ "one@example.com", { "email": "two@example.com", "reason": "complaint" } ] }' ``` ```json title="response — 201 Created" { "count": 2, "already_suppressed": 0, "duplicates": 0 } ``` `count` is what was written, `already_suppressed` was on the list before, and `duplicates` is how many rows the payload repeated. The three add up to the number of items you sent. Migrating from another provider? Export their suppression list and import it here **before** your first send, so addresses that already bounced or complained don't get a fresh attempt from a new IP. The dashboard has a CSV importer that handles the export formats from SendGrid, Mailgun, Postmark, and SES. ## Remove an address [#remove-an-address] `DELETE /suppressions/:id` The path accepts either the entry `id` or the address itself, so you can un-suppress from your own records without looking up an id first. ```bash title="request" curl -X DELETE https://api.eusend.dev/suppressions/invalid@example.com \ -H "Authorization: Bearer eu_live_xxxxxxxxxxxx" ``` ```json title="response — 200 OK" { "deleted": 1 } ``` Returns `404` if the address is not on the list. ## Export [#export] `GET /suppressions/export` Returns the whole list as CSV (`email,reason,created_at`), streamed — safe to call on a list of any size. ```bash title="request" curl "https://api.eusend.dev/suppressions/export" \ -H "Authorization: Bearer eu_live_xxxxxxxxxxxx" \ -o suppressions.csv ``` # Tags URL: https://eusend.dev/docs/emails/tags Label your sends to filter the email log and route webhook events by category, customer, or anything else you track. Tags are key-value labels you attach to a send. They exist for two jobs: * **Filtering your log.** "Show me every password-reset send from the last 7 days" is one click in the dashboard, or one query parameter on `GET /emails`. * **Routing webhooks.** Every `email.*` event for a send carries its tags, so your handler can branch on `payload.tags.category` instead of looking the email up first. ## Adding tags to a send [#adding-tags-to-a-send] Pass `tags` as an object: ```bash title="request" curl -X POST https://api.eusend.dev/emails \ -H "Authorization: Bearer eu_live_xxxxxxxxxxxx" \ -H "Content-Type: application/json" \ -d '{ "from": "noreply@acme.com", "to": "alice@example.com", "subject": "Reset your password", "html": "

Here is your reset link.

", "tags": { "category": "password_reset", "tier": "pro" } }' ``` The `[{ "name": ..., "value": ... }]` array form works identically, so a payload written against Resend's API sends here unchanged: ```json { "tags": [ { "name": "category", "value": "password_reset" }, { "name": "tier", "value": "pro" } ] } ``` Responses and webhook payloads always return the object form. Tags work on `POST /emails` and on every item of `POST /emails/batch`. | Parameter | Type | Description | | --- | --- | --- | | `Maximum tags per email` | `10` | Applies to each item of a batch send independently. | | `Allowed characters` | `A–Z a–z 0–9 _ -` | Names and values alike. No spaces, colons, dots, or non-ASCII characters — a value like an email address or a timestamp will be rejected, so hash or slugify those first. | | `Maximum name length` | `64 characters` | | | `Maximum value length` | `256 characters` | | > [!NOTE] > Tags are for grouping sends, not for carrying data. Something high-cardinality — a user ID, an > order number — makes a filter that matches exactly one email, which the email ID already does > better. Tag the *kind* of mail, and keep the identifier in your own system. ## Filtering the log [#filtering-the-log] In the dashboard, tags render as chips on the email list and detail pages. Clicking one filters the log to it. Over the API, pass `tag` to `GET /emails`: ```bash # every send tagged category=password_reset curl "https://api.eusend.dev/emails?tag=category:password_reset" \ -H "Authorization: Bearer eu_live_xxxxxxxxxxxx" # every send carrying a category tag at all, whatever its value curl "https://api.eusend.dev/emails?tag=category" \ -H "Authorization: Bearer eu_live_xxxxxxxxxxxx" # repeat the parameter to require several — this matches both curl "https://api.eusend.dev/emails?tag=category:welcome&tag=tier:pro" \ -H "Authorization: Bearer eu_live_xxxxxxxxxxxx" ``` `tag` combines with the other filters (`status`, `from`, `to`) and with cursor pagination. ## Tags in webhooks [#tags-in-webhooks] Every `email.*` event carries the sending email's tags, as an object. Sends made without tags carry `"tags": {}` rather than omitting the field, so a handler can read `payload.tags.category` without guarding first. ```json title="email.delivered" { "type": "email.delivered", "email_id": "9a8b7c6d-5e4f-4a3b-8c1d-0e9f8a7b6c5d", "recipients": ["alice@example.com"], "tags": { "category": "password_reset", "tier": "pro" }, "timestamp": "2026-08-06T10:24:31.000Z" } ``` This makes a single webhook endpoint enough for several kinds of mail: ```ts app.post('/webhooks/eusend', (req, res) => { const { type, tags } = req.body if (type === 'email.bounced' && tags.category === 'password_reset') { // A reset mail that bounced is a locked-out user — page someone. alertOnCriticalBounce(req.body) } res.sendStatus(200) }) ``` ## Tags over SMTP [#tags-over-smtp] If you relay through the SMTP bridge rather than the API, add an `X-Eusend-Tag` header. It may repeat, and one header may carry several comma-separated pairs: ``` X-Eusend-Tag: category=password_reset X-Eusend-Tag: tier=pro, region=eu ``` Pairs that don't fit the character rules are dropped and the message still sends — unlike the API, SMTP has no useful way to hand back a validation error, and a bounced invoice is a worse outcome than an untagged one. # Auth.js (NextAuth) URL: https://eusend.dev/docs/frameworks/authjs Send Auth.js magic-link sign-in email through eusend, over SMTP with the Nodemailer provider or over HTTP with a custom provider. Auth.js sends one kind of email: the magic link for passwordless sign-in. It can send it through any SMTP server or through a function you write, and eusend works with both. Use SMTP if you want the least code; use the HTTP provider if you want your own template, or your runtime has no TCP sockets. Either way Auth.js needs a [database adapter](https://authjs.dev/getting-started/database) to store the verification token, and eusend needs a [verified domain](/docs/domains) for the `from` address. ```bash title=".env.local" EUSEND_API_KEY=eu_live_... EMAIL_FROM="Acme " ``` ## Option 1 — SMTP with the Nodemailer provider [#option-1--smtp-with-the-nodemailer-provider] ```bash npm install nodemailer ``` ```ts title="auth.ts" import NextAuth from 'next-auth' import Nodemailer from 'next-auth/providers/nodemailer' export const { handlers, auth, signIn, signOut } = NextAuth({ adapter, // your database adapter providers: [ Nodemailer({ server: { host: 'smtp.eusend.dev', port: 465, secure: true, auth: { user: 'eusend', pass: process.env.EUSEND_API_KEY }, }, from: process.env.EMAIL_FROM, }), ], }) ``` The username is always the literal word `eusend`; the API key is the password. Port 465 uses implicit TLS, so `secure` must be `true` — eusend does not offer STARTTLS on 587. ## Option 2 — HTTP with a custom provider [#option-2--http-with-a-custom-provider] Auth.js accepts a provider of type `email` with your own `sendVerificationRequest`. This one calls the eusend API with `fetch`, so it runs anywhere, including edge runtimes. ```ts title="auth.ts" import NextAuth from 'next-auth' export const { handlers, auth, signIn, signOut } = NextAuth({ adapter, // your database adapter providers: [ { id: 'http-email', name: 'Email', type: 'email', maxAge: 60 * 60 * 24, async sendVerificationRequest({ identifier: to, url }) { const { host } = new URL(url) const res = await fetch('https://api.eusend.dev/emails', { method: 'POST', headers: { Authorization: `Bearer ${process.env.EUSEND_API_KEY}`, 'Content-Type': 'application/json', }, body: JSON.stringify({ from: process.env.EMAIL_FROM, to, subject: `Sign in to ${host}`, html: `

Sign in to ${host}

If you did not request this, you can ignore this email.

`, text: `Sign in to ${host}\n${url}\n\nIf you did not request this, you can ignore this email.`, track_clicks: false, }), }) if (!res.ok) { const { code } = await res.json() throw new Error(`eusend refused the sign-in email: ${code}`) } }, }, ], }) ``` Then start the flow with the provider's id: `signIn('http-email', { email })`. > [!WARNING] > Keep click tracking off for magic links, as above. Tracking rewrites the link through a redirect, > and a sign-in link should go straight to your app. ## Why a sign-in email fails [#why-a-sign-in-email-fails] Auth.js surfaces a thrown error as a generic sign-in failure, so check the [email log](https://eusend.dev/emails) first. The usual causes: * `DOMAIN_NOT_VERIFIED` — the `from` domain has not finished verifying. * `ALL_SUPPRESSED` — the address hard-bounced or complained before and is on your [suppression list](/docs/emails/suppressions). * `DAILY_LIMIT_EXCEEDED` — the free plan's daily cap. A sign-in flow should not be the place you find out, so watch your usage on the [dashboard](/docs/dashboard). ## See also [#see-also] * [Next.js](/docs/frameworks/nextjs) for the rest of your app's email. * [Better Auth](/docs/integrations/better-auth), which has an official eusend plugin with default templates. # FastAPI URL: https://eusend.dev/docs/frameworks/fastapi Send transactional email from FastAPI through eusend with the Python SDK — in a background task so the response is not held up, with idempotent retries and typed errors. The eusend Python SDK is synchronous and built on the standard library, so it has no HTTP client to conflict with yours. In FastAPI that means one rule: don't call it directly inside an `async def` endpoint, where it would block the event loop. Use a background task, or a plain `def` endpoint, and FastAPI runs the call in its thread pool. ## Setup [#setup] ```bash pip install eusend ``` ```bash title=".env" EUSEND_API_KEY=eu_test_... ``` The SDK reads `EUSEND_API_KEY` from the environment, so there is nothing to configure in code. An `eu_test_` key runs validation, quota and suppression checks and logs the email without delivering it. ## Send in a background task [#send-in-a-background-task] For email the caller does not need confirmed — a welcome message, a notification — respond first and send afterwards: ```python title="main.py" import logging import eusend from fastapi import BackgroundTasks, FastAPI from pydantic import BaseModel, EmailStr app = FastAPI() log = logging.getLogger(__name__) class Signup(BaseModel): name: str email: EmailStr def send_welcome(name: str, email: str) -> None: try: eusend.Emails.send({ 'from': 'Acme ', 'to': email, 'subject': 'Welcome to Acme', 'html': f'

Hi {name}, thanks for signing up.

', }) except eusend.EusendError as e: log.warning('welcome email failed: %s %s', e.code, e.message) @app.post('/signup', status_code=201) async def signup(body: Signup, background_tasks: BackgroundTasks): background_tasks.add_task(send_welcome, body.name, body.email) return {'ok': True} ``` `EmailStr` needs `pip install "pydantic[email]"`. Escape anything user-supplied before it goes into `html` — the example above keeps it short, and `html.escape(name)` is the fix. ## Send and report the result [#send-and-report-the-result] When the caller does need to know — a receipt, a password reset — use a `def` endpoint and turn the SDK's exception into a response: ```python from fastapi import HTTPException class Receipt(BaseModel): order_id: str email: EmailStr @app.post('/receipts') def send_receipt(body: Receipt): try: email = eusend.Emails.send( { 'from': 'Acme ', 'to': body.email, 'subject': f'Receipt for order {body.order_id}', 'html': '

Thanks — your order is confirmed.

', }, options={'idempotency_key': f'receipt-{body.order_id}'}, ) except eusend.EusendError as e: raise HTTPException(status_code=502, detail=e.code) return {'id': email['id']} ``` The `idempotency_key` makes a retried request return the original email instead of sending a second one. Branch on `e.code` — the [error code](/docs/reference/error-codes) — not on the message. `eusend.RateLimitError` is the subclass to catch if you want to back off on a `429`. ## Surviving a restart [#surviving-a-restart] A background task lives in the process: if the server restarts before it runs, the email is never sent. For mail that must go out, put the send on a real queue (Celery, RQ, Arq) and keep the `idempotency_key` so a retried job cannot send twice. ## Next steps [#next-steps] * [Python SDK reference](/docs/sdks/python) for attachments, scheduling and batch sends. * [Verify a domain](/docs/domains) to send to real recipients from your own address. * [Webhooks](/docs/webhooks) to learn when a message is delivered, bounced or complained about. # Next.js URL: https://eusend.dev/docs/frameworks/nextjs Send transactional email from a Next.js app through eusend — from a Server Action or a Route Handler, with React Email templates and without blocking the response. Next.js runs your sending code on the server, so the eusend SDK works as it does anywhere else in Node.js. This page covers the two places a send usually lives — a Server Action and a Route Handler — and the two things that go wrong most often: a key that leaks into the client bundle, and a serverless function frozen before the request to eusend finishes. ## Setup [#setup] ### Install the SDK [#install-the-sdk] ```bash npm install @eusend_dev/sdk ``` ### Add the API key [#add-the-api-key] Create a key under [API keys](https://eusend.dev/api-keys). Keep it out of any variable prefixed `NEXT_PUBLIC_` — those are inlined into the browser bundle. ```bash title=".env.local" EUSEND_API_KEY=eu_test_... ``` An `eu_test_` key runs validation, quota and suppression checks and shows the email in your log without delivering it. Switch to an `eu_live_` key when you deploy. ### Create one client [#create-one-client] ```ts title="lib/eusend.ts" import 'server-only' import { Eusend } from '@eusend_dev/sdk' export const eusend = new Eusend(process.env.EUSEND_API_KEY) ``` `server-only` turns an accidental import from a Client Component into a build error. ## Send from a Server Action [#send-from-a-server-action] ```ts title="app/contact/actions.ts" 'use server' import { eusend } from '@/lib/eusend' export async function sendContactMessage(formData: FormData) { const email = String(formData.get('email') ?? '') const message = String(formData.get('message') ?? '') const { error } = await eusend.emails.send({ from: 'Acme ', to: 'support@yourdomain.com', replyTo: email, subject: 'New contact form message', text: message, }) if (error) return { ok: false, code: error.name } return { ok: true } } ``` The SDK returns `{ data, error }` instead of throwing, so a failed send is a value you can return to the form. Branch on `error.name` — the [error code](/docs/reference/error-codes) — not on the message. > [!WARNING] > A public form that sends email is an open relay unless you bound it. Send to your own address and > put the visitor in `replyTo`, as above, and rate-limit the action. Never let a form field choose > the recipient. ## Send from a Route Handler [#send-from-a-route-handler] ```ts title="app/api/receipt/route.ts" import { eusend } from '@/lib/eusend' export async function POST(request: Request) { const { orderId, email } = await request.json() const { data, error } = await eusend.emails.send( { from: 'Acme ', to: email, subject: `Receipt for order ${orderId}`, html: `

Thanks — order ${orderId} is confirmed.

`, }, { idempotencyKey: `receipt-${orderId}` }, ) if (error) return Response.json({ code: error.name }, { status: error.statusCode ?? 502 }) return Response.json({ id: data.id }) } ``` The `idempotencyKey` makes a retried request — a double click, a webhook redelivery — return the original email instead of sending a second one. ## React Email templates [#react-email-templates] Pass a component as `react` and the SDK renders it to HTML before sending: ```tsx title="app/api/welcome/route.tsx" import { eusend } from '@/lib/eusend' import { WelcomeEmail } from '@/emails/welcome' export async function POST(request: Request) { const { name, email } = await request.json() const { error } = await eusend.emails.send({ from: 'Acme ', to: email, subject: 'Welcome to Acme', react: , }) return Response.json({ ok: !error }) } ``` This needs `react` and `@react-email/render` installed. The file must be `.tsx`. ## Don't block the response [#dont-block-the-response] Sending adds a network round trip to the request. When the user doesn't need the result, schedule it with `after` so the response goes out first and the platform keeps the function alive until the send finishes: ```ts import { after } from 'next/server' after(async () => { const { error } = await eusend.emails.send({ ... }) if (error) console.error('welcome email failed', error.name) }) ``` Without `after`, a send you don't `await` can be cut off when a serverless function is frozen after responding. ## Next steps [#next-steps] * [Verify a domain](/docs/domains) to send to real recipients from your own address. * [Auth.js](/docs/frameworks/authjs) or [Better Auth](/docs/integrations/better-auth) for sign-in and verification email. * [Webhooks](/docs/webhooks) to learn when a message is delivered, bounced or complained about. # SvelteKit URL: https://eusend.dev/docs/frameworks/sveltekit Send transactional email from SvelteKit through eusend — from a form action or a server endpoint, with the API key kept in private environment variables. In SvelteKit, sending belongs in code that only runs on the server: a form action in `+page.server.ts`, or an endpoint in `+server.ts`. The eusend SDK uses the native `fetch`, so it runs on the Node, Vercel, Netlify and Cloudflare adapters alike. ## Setup [#setup] ```bash npm install @eusend_dev/sdk ``` ```bash title=".env" EUSEND_API_KEY=eu_test_... ``` Read the key through `$env/static/private`. SvelteKit refuses to build if a private variable is imported into client code, which is the guarantee you want for an API key. ```ts title="src/lib/server/eusend.ts" import { Eusend } from '@eusend_dev/sdk' import { EUSEND_API_KEY } from '$env/static/private' export const eusend = new Eusend(EUSEND_API_KEY) ``` Files under `src/lib/server` cannot be imported from the browser either. ## Send from a form action [#send-from-a-form-action] ```ts title="src/routes/contact/+page.server.ts" import { fail } from '@sveltejs/kit' import { eusend } from '$lib/server/eusend' import type { Actions } from './$types' export const actions = { default: async ({ request }) => { const form = await request.formData() const email = String(form.get('email') ?? '') const message = String(form.get('message') ?? '') if (!email || !message) return fail(400, { email, missing: true }) const { error } = await eusend.emails.send({ from: 'Acme ', to: 'support@yourdomain.com', replyTo: email, subject: 'New contact form message', text: message, }) if (error) return fail(502, { email, code: error.name }) return { sent: true } }, } satisfies Actions ``` ```svelte title="src/routes/contact/+page.svelte" {#if form?.sent}

Thanks — we will get back to you.

{:else}
{#if form?.code}

Could not send your message. Please try again.

{/if}
{/if} ``` The SDK returns `{ data, error }` rather than throwing. `error.name` is the [error code](/docs/reference/error-codes) — log it, and show the visitor something plainer. > [!WARNING] > Send form submissions to your own address with the visitor in `replyTo`. A form field that chooses > the recipient lets anyone send mail from your domain. ## Send from an endpoint [#send-from-an-endpoint] ```ts title="src/routes/api/receipt/+server.ts" import { json } from '@sveltejs/kit' import { eusend } from '$lib/server/eusend' import type { RequestHandler } from './$types' export const POST: RequestHandler = async ({ request }) => { const { orderId, email } = await request.json() const { data, error } = await eusend.emails.send( { from: 'Acme ', to: email, subject: `Receipt for order ${orderId}`, html: `

Thanks — order ${orderId} is confirmed.

`, }, { idempotencyKey: `receipt-${orderId}` }, ) if (error) return json({ code: error.name }, { status: error.statusCode ?? 502 }) return json({ id: data.id }) } ``` The `idempotencyKey` makes a retry return the original email instead of sending a second one. ## Next steps [#next-steps] * [Verify a domain](/docs/domains) to send to real recipients from your own address. * [Templates](/docs/templates) to keep email markup out of your routes. * [Webhooks](/docs/webhooks) to learn when a message is delivered, bounced or complained about. # Authentication URL: https://eusend.dev/docs/getting-started/authentication Authenticate with API keys in the Authorization header. All API requests must include an API key in the `Authorization` header. ```bash Authorization: Bearer eu_live_xxxxxxxxxxxx ``` ## Key types [#key-types] | Parameter | Type | Description | | --- | --- | --- | | `eu_live_...` | `string` | Production key. Emails are actually sent. | | `eu_test_...` | `string` | Test key. Emails are queued but not delivered. Use for development and CI. | > [!TIP] > Test mode keys replay the full event lifecycle — and fire the same webhooks — as live keys, > without delivering to the recipient's inbox. By default a send simulates `email.sent` → > `email.delivered` → `email.opened` → `email.clicked` (opens and clicks follow the message's > tracking settings). To simulate failures, send to `bounced@…` for a bounce or `complained@…` for a > complaint. Ideal for integration testing. ## Permissions [#permissions] Test-mode keys cannot create, update, or delete webhook endpoints, delete audiences or templates, or delete contacts individually or in bulk. These resources are shared with live sending. Use a live key or the dashboard to manage them; test sends still trigger your configured webhooks. Test-mode sends use no quota, and are capped at 10,000 per organization per day (UTC). Past that the API answers `429` with `DAILY_LIMIT_EXCEEDED` until midnight; live sends are unaffected. Every key carries a permission, chosen when you create it. It defaults to `full_access`. | Parameter | Type | Description | | --- | --- | --- | | `full_access` | `string` | Can create, read, update and delete every resource. The default. | | `sending_access` | `string` | Can only send emails. Every other endpoint returns 403 FORBIDDEN. | A `sending_access` key may call exactly these endpoints — everything else, including reading your email logs, is refused: | Method | Endpoint | | | ------- | -------------------- | --------------------------- | | `POST` | `/emails` | Send an email | | `POST` | `/emails/batch` | Send up to 100 emails | | `PATCH` | `/emails/:id` | Reschedule a scheduled send | | `POST` | `/emails/:id/cancel` | Cancel a scheduled send | SMTP submission is covered too: a `sending_access` key works as an SMTP password exactly like a full-access one, because the SMTP gateway relays through `POST /emails`. > [!NOTE] > Reads are deliberately excluded. `GET /emails/:id` returns the rendered body, the full recipient > list and the delivery event history — that's the half of a leaked key worth stealing. Give your > application server a `sending_access` key, and keep `full_access` for tooling you control. ## Restricting a key to one domain [#restricting-a-key-to-one-domain] A `sending_access` key can be pinned to a single sending domain with `domain_id`. Sends from any other domain are rejected with `403 FORBIDDEN`, including the shared onboarding sandbox domain. Omit `domain_id` and the key can send from any of your verified domains. ```bash curl -X POST https://api.eusend.dev/api-keys \ -H "Authorization: Bearer eu_live_xxxxxxxxxxxx" \ -H "Content-Type: application/json" \ -d '{ "name": "Billing service", "permission": "sending_access", "domain_id": "5e9f2c1a-..." }' ``` `domain_id` is only valid together with `sending_access` — pairing it with `full_access` returns `400 VALIDATION_ERROR`, since a full-access key can mint itself an unrestricted key anyway. The restriction applies to test-mode keys as well, so a scoped key behaves the same in CI as it will in production. > [!WARNING] > Deleting a domain also revokes every key restricted to it. A restriction that quietly widened to > "all domains" when its domain went away would be a silent privilege escalation, so the key goes > with it. ## Creating API keys [#creating-api-keys] API keys are managed in the **API Keys** section of the dashboard, which prompts for the permission and domain restriction when you create one. You can create multiple keys and revoke them individually. Free plan allows 1 live key and 1 test key; paid plans allow unlimited keys. # Quick Start URL: https://eusend.dev/docs/getting-started/quick-start Send your first email in three steps. ## 1. Get your API key [#1-get-your-api-key] Sign up at [eusend.dev/signup](https://eusend.dev/signup), then navigate to **API Keys** in the dashboard and create a new key. Your key starts with `eu_live_` for production or `eu_test_` for test mode. Test mode allows you to use the API while preventing actual email delivery — ideal for development and testing. ## 2. Verify your sending domain [#2-verify-your-sending-domain] To send to real recipients, you must [add and verify your domain](/docs/domains) in the dashboard. This sets up DKIM signing so your emails are authenticated and deliverable. Emails from unverified domains will be rejected. Verification usually completes within minutes of adding the DNS records. > [!TIP] > No DNS access handy? Skip this step for now: send from `onboarding@sandbox.eusend.dev` and eusend > will deliver it — to your own account email, or a teammate's, only. It's a shared sandbox for > trying the API, capped per day; verify your own domain to send to anyone. ## 3. Send an email [#3-send-an-email] ```bash title="request" curl -X POST https://api.eusend.dev/emails \ -H "Authorization: Bearer eu_live_xxxxxxxxxxxx" \ -H "Content-Type: application/json" \ -d '{ "from": "Acme ", "to": "you@yourdomain.com", "subject": "Hello from eusend", "html": "

Hello!

Your first email via eusend.

" }' ``` ```json title="response" { "id": "9a8b7c6d-5e4f-4a3b-8c1d-0e9f8a7b6c5d" } ``` > [!NOTE] > Prefer a native library? Official SDKs wrap the same API: [Node.js](/docs/sdks/nodejs), > [Python](/docs/sdks/python), and [Go](/docs/sdks/go). > [!TIP] > Prefer a UI? Everything above can be done without touching the API — see the [Dashboard > Overview](/docs/dashboard/overview) for a guided walkthrough. # Better Auth URL: https://eusend.dev/docs/integrations/better-auth Send Better Auth's verification, password-reset, OTP, magic-link and invitation email through eusend with the official plugin — branded default templates, non-blocking sends, and contact sync for verified users. Better Auth doesn't ship an email transport. It asks you for a function for each email it needs — verify an address, reset a password, send a sign-in code. `@eusend_dev/better-auth` is a Better Auth plugin that supplies those functions, with default templates you can brand or replace, and can add verified users to an eusend audience. eusend is one of the providers listed in Better Auth's [email docs](https://better-auth.com/docs/concepts/email#bring-your-own-email-provider), and the eusend dashboard runs on Better Auth too. ## Installation [#installation] ```bash npm install @eusend_dev/better-auth # or bun add @eusend_dev/better-auth ``` ## Setup [#setup] ### Verify your sending domain [#verify-your-sending-domain] Add your domain under [Domains](https://eusend.dev/domains) and publish the DNS records — eusend only sends from a verified domain. See [domains](/docs/domains) if you have not done this yet. ### Add the API key [#add-the-api-key] Create a key under [API keys](https://eusend.dev/api-keys) and put it in your environment. The plugin reads `EUSEND_API_KEY` by default. ```bash title=".env" EUSEND_API_KEY=eu_live_... ``` Use an `eu_test_` key while developing: the send goes through validation, quota and suppression checks and shows up in your email log, but nothing is delivered. ### Add the plugin [#add-the-plugin] ```ts title="lib/auth.ts" import { betterAuth } from 'better-auth' import { eusend } from '@eusend_dev/better-auth' export const auth = betterAuth({ emailAndPassword: { enabled: true, requireEmailVerification: true }, emailVerification: { sendOnSignUp: true }, plugins: [ eusend({ email: { from: 'Acme ', appName: 'Acme', brand: { logoUrl: 'https://acme.com/logo.png', primaryColor: '#4f46e5', supportEmail: 'help@acme.com', }, }, }), ], }) ``` Sign up with a real address and the verification email arrives from your domain. The plugin also sends password-reset emails and a "your password was changed" notice after a reset. Everything the plugin sets is a default. Better Auth merges plugin options underneath your own, so a `sendVerificationEmail` you already wrote keeps working, and the plugin never turns on password sign-in: `emailAndPassword.enabled` stays whatever you set. ## Email OTP, magic links and invitations [#email-otp-magic-links-and-invitations] These emails belong to other Better Auth plugins — [Email OTP](https://better-auth.com/docs/plugins/email-otp), [Magic link](https://better-auth.com/docs/plugins/magic-link) and [Organization](https://better-auth.com/docs/plugins/organization) — so build the senders once and pass them in: ```ts title="lib/auth.ts" import { eusend, eusendAuthEmails } from '@eusend_dev/better-auth' import { emailOTP, magicLink, organization } from 'better-auth/plugins' const emails = eusendAuthEmails({ from: 'Acme ', appName: 'Acme', appUrl: 'https://app.acme.com', }) export const auth = betterAuth({ plugins: [ eusend({ email: { from: 'Acme ', appName: 'Acme' } }), emailOTP({ sendVerificationOTP: emails.otp }), magicLink({ sendMagicLink: emails.magicLink }), organization({ sendInvitationEmail: emails.invitation }), ], }) ``` The OTP subject names the flow — sign-in, email verification, password reset or email change. Invitation links default to `${appUrl}/accept-invitation/${id}`, the route Better Auth's docs use; pass `invitationUrl: ({ id }) => ...` for your own. ## Sends don't block the response [#sends-dont-block-the-response] No sender waits for eusend to answer. That is what [Better Auth recommends](https://better-auth.com/docs/concepts/email): an endpoint that waits for the send responds faster when an address has no account, and that difference tells an attacker which addresses are registered. On a long-running server nothing else is needed. On serverless, the function can be frozen as soon as the response goes out, so hand the send to the platform: ```ts title="lib/auth.ts" import { after } from 'next/server' eusend({ waitUntil: after, email: { from: 'Acme ', appName: 'Acme' } }) ``` On Vercel outside Next.js, use `waitUntil` from `@vercel/functions`; on Cloudflare Workers, use `ctx.waitUntil`. ## Syncing users to an audience [#syncing-users-to-an-audience] Add `sync` and users are added to an [audience](/docs/audiences) once their email is verified, ready for your product updates and [broadcasts](/docs/broadcasts): ```ts title="lib/auth.ts" eusend({ email: { from: 'Acme ', appName: 'Acme' }, sync: { audienceId: process.env.EUSEND_AUDIENCE_ID!, properties: (user) => ({ user_id: user.id }), }, }) ``` * **Verified addresses only.** Password sign-ups are added when they verify. Users whose provider already verified them, like Google or GitHub, are added when they are created. A sign-up form accepts typos and other people's addresses, and mailing those damages your sending domain's reputation. * **Nothing is overwritten.** The sync merges into an existing contact. It never clears properties or names you set elsewhere, and it never removes an opt-out: someone who unsubscribed and later signs up stays unsubscribed. * **Every sign-up path.** It runs on Better Auth's database hooks, so email and password, OAuth, magic link, OTP and admin-created users all go through it, alongside any database hooks of your own. Syncing adds a contact; whether someone agreed to marketing email is still yours to record. [Topics](/docs/audiences/topics) let contacts choose which kinds of email they get. ## Templates [#templates] The default templates are plain HTML with a text version, and carry no eusend branding — they read as coming from your app. Everything you pass in is HTML-escaped, and a link that isn't `http` or `https` is refused rather than rendered. Replace any of the six — `verification`, `resetPassword`, `passwordChanged`, `magicLink`, `otp`, `invitation`: ```ts title="lib/auth.ts" eusend({ email: { from: 'Acme ', appName: 'Acme', templates: { verification: ({ user, url }, { appName }) => ({ subject: `Confirm your ${appName} account`, html: renderMyEmail({ user, url }), text: `Confirm your account: ${url}`, }), }, }, }) ``` If your templates are React Email components, render them in the template with `@react-email/render`. ## Errors and the email log [#errors-and-the-email-log] A failed send never throws into Better Auth — a sign-up still succeeds when its email could not be sent. Failures are logged with `console.error`, or passed to your own handler: ```ts eusend({ onError: ({ category, to, code, message }) => logger.warn({ category, to, code }, message), email: { from: 'Acme ', appName: 'Acme' }, }) ``` The two codes you are most likely to meet first: * `DOMAIN_NOT_VERIFIED` — `from` is on a domain that has not finished verifying. Check it under [Domains](https://eusend.dev/domains). * `ALL_SUPPRESSED` — the recipient hard-bounced or complained before and is on your [suppression list](/docs/emails/suppressions). Every message is tagged `source: better-auth` and `category: verification` (or `reset-password`, `password-changed`, `otp`, `magic-link`, `invitation`), so the [email log](/docs/dashboard) can show only auth mail. Click tracking is off for auth email: some link scanners follow every link in a message, and following a tracked single-use link would use it up before the user clicks. ## Options [#options] | Parameter | Type | Description | | --- | --- | --- | | `apiKey` | `string` | An eusend API key. Defaults to EUSEND_API_KEY. | | `waitUntil` | `(promise) => void` | Keeps sends alive after the response on serverless — after, waitUntil or ctx.waitUntil. | | `onError` | `(error) => void` | Receives { category, to, code, message } for a failed send or sync. Defaults to console.error. | | `baseUrl` | `string` | Override the API host. Only useful against a staging deployment. | | `email.from` (required) | `string` | Sender for every auth email. Its domain must be verified on your account. | | `email.appName` (required) | `string` | Your product name, used in subjects and copy. | | `email.brand` | `object` | logoUrl (absolute https), primaryColor (hex) and supportEmail. | | `email.replyTo` | `string` | Reply-to address for auth email. | | `email.templates` | `object` | Replace any of the six templates. | | `email.tags` | `Record` | Extra tags on every send, up to 8. | | `email.appUrl` | `string` | Your app URL, used to build invitation links. | | `email.invitationUrl` | `({ id, email }) => string` | Build invitation links yourself instead. | | `sync.audienceId` (required) | `string` | The audience verified users are added to. | | `sync.properties` | `(user) => Record` | Custom contact properties, merged into what the contact already has. | `eusendAuthEmails()` takes the same fields as `email`, plus `apiKey`, `waitUntil`, `onError` and `baseUrl`. ## Where auth email is processed [#where-auth-email-is-processed] Every auth email carries personal data — who signed up and when — plus a link or code that logs someone into your app. With eusend, that message is accepted, stored and delivered on infrastructure in the EU, by a company with no US parent. That keeps it out of the third-country-transfer section of your privacy review. See [sub-processors](https://eusend.dev/legal/subprocessors) for the full list. ## Without the plugin [#without-the-plugin] If you would rather write the senders yourself, call the [Node SDK](/docs/sdks) from Better Auth's hooks. Don't await the send, for the reason [above](#sends-dont-block-the-response): ```ts title="lib/auth.ts" import { betterAuth } from 'better-auth' import { Eusend } from '@eusend_dev/sdk' const eusend = new Eusend() export const auth = betterAuth({ emailVerification: { sendVerificationEmail: async ({ user, url }) => { void eusend.emails.send({ from: 'Acme ', to: user.email, subject: 'Verify your email address', html: `

Verify your email address

`, tags: { source: 'better-auth', category: 'verification' }, }) }, }, }) ``` The SDK returns `{ data, error }` rather than throwing, so check `error` if you want failures logged. ## Coming from Resend [#coming-from-resend] If you followed Resend's Better Auth guide, your senders call `resend.emails.send()`. Either replace them with the plugin, or keep them and swap the client — the payload shape is the same: ```ts title="lib/auth.ts" - import { Resend } from 'resend' + import { Eusend } from '@eusend_dev/sdk' - const resend = new Resend(process.env.RESEND_API_KEY) + const eusend = new Eusend(process.env.EUSEND_API_KEY) - await resend.emails.send({ from, to, subject, html }) + await eusend.emails.send({ from, to, subject, html }) ``` # Payload CMS URL: https://eusend.dev/docs/integrations/payload Send Payload's verification, password-reset and application email through eusend with the official email adapter — a REST adapter that works on serverless, unlike SMTP. Payload sends email through an *email adapter*: a small object in your `payload.config.ts` that every `payload.sendEmail()` call, and every built-in auth email, goes through. `@eusend_dev/payload-email` is the eusend adapter. It calls the eusend REST API rather than SMTP, so it works in serverless functions — where holding an SMTP connection open is the usual reason `@payloadcms/email-nodemailer` misbehaves. ## Installation [#installation] ```bash npm install @eusend_dev/payload-email # or bun add @eusend_dev/payload-email ``` ## Setup [#setup] ### Verify your sending domain [#verify-your-sending-domain] Add your domain under [Domains](https://eusend.dev/domains) and publish the DNS records — the adapter can only send from a verified domain. See [domains](/docs/domains) if you have not done this yet. ### Add the API key [#add-the-api-key] Create a key under [API keys](https://eusend.dev/api-keys) and put it in your environment: ```bash title=".env" EUSEND_API_KEY=eu_live_... ``` ### Configure the adapter [#configure-the-adapter] ```ts title="payload.config.ts" import { buildConfig } from 'payload' import { eusendAdapter } from '@eusend_dev/payload-email' export default buildConfig({ email: eusendAdapter({ apiKey: process.env.EUSEND_API_KEY || '', defaultFromAddress: 'hello@yourdomain.com', defaultFromName: 'Your app', }), // ...the rest of your config }) ``` ### Send [#send] ```ts await payload.sendEmail({ to: 'customer@example.com', subject: 'Your order is confirmed', html: '

Thanks for your order!

', }) ``` Payload's own auth emails — email verification and password resets — now go the same way, and every message appears in your [email log](/docs/dashboard). ## Options [#options] | Parameter | Type | Description | | --- | --- | --- | | `apiKey` (required) | `string` | An eusend API key. | | `defaultFromAddress` (required) | `string` | Sender used when a message sets no from. Its domain must be verified on your account. | | `defaultFromName` (required) | `string` | Display name paired with defaultFromAddress. | | `overrideRecipientAddress` | `string` | Redirect every message to this address instead of its real recipients. cc and bcc are dropped along with them, so a staging environment cannot copy a real customer. | | `tags` | `Record` | Tags added to every send, e.g. { source: "payload" }. They filter the email log and are returned on the webhook events for the send. | | `trackOpens` | `boolean` | Override open tracking for messages sent through this adapter. | | `trackClicks` | `boolean` | Override click tracking for messages sent through this adapter. | | `baseUrl` | `string` | Override the API host. Only useful against a staging deployment. | ## Tagging Payload's email [#tagging-payloads-email] Tags let you tell Payload's traffic apart from the rest of your sending in the email log, and route it in [webhooks](/docs/webhooks): ```ts email: eusendAdapter({ apiKey: process.env.EUSEND_API_KEY || '', defaultFromAddress: 'hello@yourdomain.com', defaultFromName: 'Your app', tags: { source: 'payload' }, }) ``` ## Staging without mailing customers [#staging-without-mailing-customers] `overrideRecipientAddress` sends everything to one inbox. Unlike the `to`-only overrides some adapters ship, `cc` and `bcc` are dropped with the real recipients — a redirected message that still copies the customer is not a redirected message. ```ts email: eusendAdapter({ apiKey: process.env.EUSEND_API_KEY || '', defaultFromAddress: 'hello@yourdomain.com', defaultFromName: 'Your app', overrideRecipientAddress: process.env.STAGING_INBOX, }) ``` ## Attachments [#attachments] `payload.sendEmail()` takes nodemailer's attachment shape. All four forms work: ```ts await payload.sendEmail({ to: 'customer@example.com', subject: 'Your invoice', html: '

Attached.

', attachments: [ { filename: 'invoice.pdf', content: pdfBuffer }, { filename: 'notes.txt', content: 'plain text' }, { path: 'https://example.com/invoice.pdf' }, { path: '/var/data/invoice.pdf' }, ], }) ``` A URL is fetched by eusend at send time; a filesystem path is read by the adapter before the request. A string `content` is treated as UTF-8 text unless you pass `encoding: 'base64'` — the same rule nodemailer applies, so an attachment ported over from `@payloadcms/email-nodemailer` arrives intact. Set `cid` on an attachment to reference it from your HTML as `` instead of showing it as a download. > [!NOTE] > Up to 20 attachments per message, 10 MB combined. ## Errors [#errors] A failed send throws Payload's `APIError`, carrying the HTTP status and the eusend [error code](/docs/reference/error-codes): ``` Error sending email: DOMAIN_NOT_VERIFIED - Domain not verified ``` The two you are most likely to meet first are `DOMAIN_NOT_VERIFIED`, when `defaultFromAddress` is on a domain that has not finished verifying, and `ALL_SUPPRESSED`, when every recipient is on your [suppression list](/docs/emails/suppressions). ## Coming from another adapter [#coming-from-another-adapter] Swapping `@payloadcms/email-resend` for eusend is the import, the factory name and the key: ```ts title="payload.config.ts" - import { resendAdapter } from '@payloadcms/email-resend' + import { eusendAdapter } from '@eusend_dev/payload-email' export default buildConfig({ - email: resendAdapter({ + email: eusendAdapter({ defaultFromAddress: 'hello@yourdomain.com', defaultFromName: 'Your app', - apiKey: process.env.RESEND_API_KEY || '', + apiKey: process.env.EUSEND_API_KEY || '', }), }) ``` From `@payloadcms/email-nodemailer`, replace the whole `transportOptions` block with the three fields above — the `defaultFromAddress` and `defaultFromName` you already have keep their meaning, and your `payload.sendEmail()` calls do not change. If you would rather keep nodemailer, eusend also speaks SMTP: see the [nodemailer guide](/docs/smtp/nodemailer). # WordPress URL: https://eusend.dev/docs/integrations/wordpress Send every WordPress email through the eusend API with the official plugin — password resets, WooCommerce receipts and form notifications, with real delivery status on each message. WordPress sends mail with PHP's `mail()` function. It is unauthenticated, it fails SPF and DKIM, and receiving servers drop it quietly. The official eusend plugin replaces that path: every `wp_mail()` call — core, WooCommerce, Contact Form 7, Gravity Forms, your theme — goes through the eusend API instead. It uses the HTTP API rather than SMTP, so nothing depends on outbound port 465 being open. That is the usual reason an SMTP plugin fails on shared or managed hosting. > [!NOTE] > Already using WP Mail SMTP or FluentSMTP? Those keep working — point them at the [SMTP > relay](/docs/smtp/wordpress) instead. The plugin is the better path when you want delivery status > inside WordPress; run one or the other, never both. ## Setup [#setup] ### Verify your sending domain [#verify-your-sending-domain] Add your domain under [Domains](https://eusend.dev/domains) and publish the DNS records. The plugin can only send from a verified domain — see [domains](/docs/domains) if you have not done this yet. ### Install the plugin [#install-the-plugin] In WordPress admin go to **Plugins → Add New**, search for **eusend**, install it and activate. ### Add the API key [#add-the-api-key] Create a key under [API keys](https://eusend.dev/api-keys), then open **Settings → eusend** and paste it in. Set **From address** to an address on your verified domain — the screen tells you straight away whether that domain is actually verified on your account. ### Send a test [#send-a-test] Use **Send a test email** on the same screen. It goes through `wp_mail()`, so a delivered test proves the whole path rather than just the API key. ### Turn on delivery events [#turn-on-delivery-events] Press **Turn on delivery events**. The plugin registers this site as a [webhook](/docs/webhooks) endpoint on your account and eusend starts posting back as each message moves — delivered, bounced, complained, opened, clicked. The email log then records what actually happened to every message, including the receiving server's own words on a bounce. Your site has to be reachable from the public internet for this; private and loopback addresses are refused. ## Configuring without the database [#configuring-without-the-database] Every setting also reads a constant in `wp-config.php` or an environment variable of the same name. Anything set that way wins over the settings screen and is shown there as read-only, which is what you want on a site deployed from git. ```php title="wp-config.php" define( 'EUSEND_API_KEY', 'eu_live_...' ); define( 'EUSEND_FROM_EMAIL', 'no-reply@yourdomain.com' ); define( 'EUSEND_FROM_NAME', 'Your site' ); ``` | Parameter | Type | Description | | --- | --- | --- | | `EUSEND_API_KEY` (required) | `string` | The API key used for every send. | | `EUSEND_FROM_EMAIL` (required) | `string` | Sender address. Its domain must be verified. | | `EUSEND_FROM_NAME` | `string` | Display name paired with the sender address. | | `EUSEND_FORCE_FROM` | `boolean` | Override the From address other plugins set. On by default. | | `EUSEND_TRACK_OPENS` | `boolean` | Per-site open-tracking override. Defaults to the account setting. | | `EUSEND_TRACK_CLICKS` | `boolean` | Per-site click-tracking override. Defaults to the account setting. | | `EUSEND_LOG_LEVEL` | `string` | disabled, errors, metadata, or full. | | `EUSEND_LOG_RETENTION_DAYS` | `number` | How long log entries are kept. 0 keeps them indefinitely. | | `EUSEND_ENABLED` | `boolean` | Set to false to hand mail back to WordPress without deactivating the plugin. | ## The email log [#the-email-log] **Settings → eusend → Email log** lists every message, what happened to it, and which plugin or theme called `wp_mail()` — so a WooCommerce receipt is distinguishable from a form notification at a glance. Logging has four levels. `metadata` is the default and keeps recipient, subject and status; `full` additionally stores the message body, which frequently contains personal data, so pair it with a short retention window. `errors` records only failures, and `disabled` writes nothing. ## WP-CLI [#wp-cli] ```bash wp eusend status # configuration, and whether another mailer conflicts wp eusend test you@example.com # send a test through wp_mail() wp eusend domains # sending domains and their verification state wp eusend log --status=bounced # recent failures, with the reason wp eusend events on # turn delivery events on or off ``` ## Hooks [#hooks] ```php // Keep one plugin's mail on the old path. add_filter( 'eusend_should_send', function ( $send, $atts ) { return str_contains( $atts['subject'], '[internal]' ) ? false : $send; }, 10, 2 ); // Tag sends so you can filter the eusend log by what produced them. add_filter( 'eusend_email_tags', function ( $tags, $atts, $source ) { $tags['category'] = 'woocommerce'; return $tags; }, 10, 3 ); // React to a bounce with the receiving server's own reason. add_action( 'eusend_webhook_event', function ( $type, $payload ) { if ( 'email.bounced' === $type ) { error_log( $payload['diagnostic'] ?? '' ); } }, 10, 2 ); ``` `eusend_email_payload` filters the request body just before it is sent, and `eusend_email_sent` fires with the eusend email ID after a message is accepted. ## Troubleshooting [#troubleshooting] | Symptom | Cause | | -------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------- | | Mail is not appearing in eusend at all | Another mail plugin is also replacing `wp_mail()`. The settings screen and Site Health both warn about this. Deactivate the other plugin. | | `DOMAIN_NOT_VERIFIED` in the log | The From address is on a domain that is not verified. Leave **Force the From address** on so no plugin can override it. | | Delivery events will not turn on | The site is not reachable from the public internet — eusend refuses private and loopback endpoints. Sending still works without them. | | Every send fails with `UNAUTHORIZED` | The API key is wrong or has been revoked. Create a new one and paste it in. | See [error codes](/docs/reference/error-codes) for the full list. # MCP server URL: https://eusend.dev/docs/mcp Connect eusend to any AI coding tool over the Model Context Protocol — send email and manage domains, audiences, and broadcasts from Claude, Cursor, Codex, and other MCP clients. The **Model Context Protocol (MCP)** lets AI tools call external services through a typed set of tools. eusend runs an MCP server so assistants like Claude Code, Claude Desktop, Cursor, and Codex can send email and manage domains, audiences, and broadcasts on your behalf — through the exact same pipeline as the HTTP API. DKIM signing, tracking, suppression, rate limits, and your sending ceilings all apply identically. In Claude, connect it straight from the [connectors directory](#claude-web-desktop-and-mobile). > [!NOTE] > Using Claude Code? The [eusend plugin](/docs/skill) installs this server *and* a skill that > teaches Claude how eusend behaves — verified senders, idempotent retries, webhook signatures — in > one command. The tools below let an assistant act on your account; the skill is what stops it > writing the integration wrong. There are two ways to connect, and they use the same tools underneath: - [**Remote (hosted)**](#remote-hosted) — Zero install — point your client at a URL. Best for getting started. - [**Local (stdio)**](#local-stdio) — Runs on your machine via npx. Your key never leaves your computer. ## How authentication works [#how-authentication-works] The hosted server accepts two kinds of credential. The local server uses an API key only. * **Sign in (OAuth), remote only:** add the URL with no key. Your client opens eusend in a browser, you sign in and approve it, and the client receives a token of its own. This is the only option for clients that cannot send a custom header, such as Claude on the web. * **API key, remote:** your client sends one of your eusend API keys on each request as an `Authorization: Bearer` header. * **API key, local:** the key is read from the `EUSEND_API_KEY` environment variable in your own MCP config and never leaves your machine. Either way the hosted server holds no credential of its own. It forwards each call to the API with the one your client presented, so it can never do anything that credential can't. ### What you choose when signing in [#what-you-choose-when-signing-in] The approval screen asks for three things, which together are the equivalent of an API key's settings: | Parameter | Type | Description | | --- | --- | --- | | `Workspace` | `required` | The one workspace the app can reach. Connect again to use it with another. | | `Access` | `Full access \| Sending only` | Full access reaches every tool. Sending only can send, reschedule and cancel email, and every other tool returns 403 FORBIDDEN. | | `Mode` | `Live \| Test mode` | In test mode calls are accepted and tracked but never delivered, exactly like an eu_test_ key. | Connected apps are listed under **Settings → Connected apps**. Disconnecting one takes effect on its next request. An app acts on behalf of the person who connected it, so it also stops working if that person leaves the workspace. ### API key permissions [#api-key-permissions] Most tools need a `full_access` key. A [`sending_access` key](/docs/getting-started/authentication#permissions) can only send, so listing domains, managing audiences and every other tool will return `403 FORBIDDEN` — useful if you want an assistant that can send mail and nothing else. > [!NOTE] > Use an `eu_test_` key while wiring things up — calls are accepted and tracked but never delivered. > Swap in an `eu_live_` key to send for real. ## Remote (hosted) [#remote-hosted] Endpoint: `https://mcp.eusend.dev/mcp`. No installation — add the URL to your client and sign in when it prompts you, or pass an `Authorization` header carrying an API key instead. ### Claude (web, desktop, and mobile) [#claude-web-desktop-and-mobile] eusend is in Claude's connectors directory. Open [Customize → Connectors](https://claude.ai/customize/connectors), search for **eusend**, select **Connect**, and sign in. On Team and Enterprise plans an Owner adds it for the organization first, and members then connect with their own eusend account. ### Claude Code [#claude-code] ```bash title="shell" claude mcp add --transport http eusend https://mcp.eusend.dev/mcp ``` Then run `/mcp` inside Claude Code and choose **Authenticate**. To use an API key instead, add the header and skip the sign-in: ```bash title="shell" claude mcp add --transport http eusend https://mcp.eusend.dev/mcp \ --header "Authorization: Bearer eu_live_xxxxxxxxxxxx" ``` ### Cursor, Windsurf, and other JSON-configured clients [#cursor-windsurf-and-other-json-configured-clients] Add a remote server entry to the client's MCP config (e.g. `.cursor/mcp.json`). With only a `url`, the client signs you in on first use: ```json title="mcp.json" { "mcpServers": { "eusend": { "url": "https://mcp.eusend.dev/mcp" } } } ``` Or pass an API key: ```json title="mcp.json" { "mcpServers": { "eusend": { "url": "https://mcp.eusend.dev/mcp", "headers": { "Authorization": "Bearer eu_live_xxxxxxxxxxxx" } } } } ``` ### Codex [#codex] ```bash title="shell" codex mcp add eusend --url https://mcp.eusend.dev/mcp ``` Then sign in with `codex mcp login eusend`, or set the `Authorization: Bearer eu_live_…` header for the `eusend` server in your Codex MCP configuration to use an API key. ## Local (stdio) [#local-stdio] The local server runs as a subprocess your client launches on demand, via [`@eusend_dev/mcp`](/docs/sdks/nodejs). Your key stays in your own config and is never sent to eusend as part of setup. Requires Node.js. ### Claude Code [#claude-code-1] ```bash title="shell" claude mcp add eusend \ --env EUSEND_API_KEY=eu_live_xxxxxxxxxxxx \ -- npx -y @eusend_dev/mcp ``` ### Claude Desktop, Cursor, and other JSON-configured clients [#claude-desktop-cursor-and-other-json-configured-clients] ```json title="mcp.json" { "mcpServers": { "eusend": { "command": "npx", "args": ["-y", "@eusend_dev/mcp"], "env": { "EUSEND_API_KEY": "eu_live_xxxxxxxxxxxx", "EUSEND_FROM": "hello@yourdomain.com" } } } } ``` > [!NOTE] > Setting `EUSEND_FROM` pins a default sender, so the assistant doesn't have to guess an address on > every send. It must be on a [verified domain](/docs/domains). ## Available tools [#available-tools] | Parameter | Type | Description | | --- | --- | --- | | `Emails` | `4 tools` | send_email, list_emails, get_email, cancel_email — send transactional mail and inspect delivery. | | `Domains` | `4 tools` | list_domains, get_domain, create_domain, verify_domain — add a sending domain, read back its DNS records, and re-check them. | | `Audiences & contacts` | `8 tools` | list_audiences, get_audience, create_audience, rename_audience, list_contacts, create_contact, list_contact_properties, create_contact_property — manage contact lists and the custom fields their contacts carry. | | `Topics` | `2 tools` | list_topics, create_topic — see the kinds of email contacts can opt into, and add one to scope a broadcast to. | | `Broadcasts` | `7 tools` | list_broadcasts, get_broadcast, create_broadcast, update_broadcast, test_broadcast, send_broadcast, cancel_broadcast — draft a broadcast with its reply-to and tracking settings, edit the draft, send yourself a test copy, then send it to an audience or cancel it. | | `Suppressions` | `2 tools` | list_suppressions, create_suppression — see which addresses are blocked and why, and stop sending to one. | | `Reputation` | `1 tool` | get_reputation — bounce and complaint rates as the sending limits judge them, what counted, and how close the account is to a halved daily limit or a pause. | > [!WARNING] > Destructive actions — deleting domains, audiences, contacts, or API keys — are intentionally > **not** exposed to the assistant. Broadcasts are also two steps: `create_broadcast` only drafts, > and `send_broadcast` is a separate call, so a bulk send is never a single accidental action. > `test_broadcast` sits between them and is the one an assistant should reach for first — it can > only deliver to your team's own inboxes or your verified domains, so it cannot reach a list by > mistake. Un-suppressing is absent for the same reason: suppressing stops mail, but removing an > entry re-enables sending to an address that bounced or complained, and doing that in bulk is what > wrecks a sender's reputation. `update_broadcast` only edits drafts, so it can never change who a > scheduled broadcast reaches. ## The sender address [#the-sender-address] Like every other way to send through eusend, the `from` address must use a domain you have verified. Sends from an unverified domain fail with `DOMAIN_NOT_VERIFIED` — see [Domain Setup](/docs/domains) to add one. Pin a default with `EUSEND_FROM` (local) so the assistant always has a valid sender to use. # API Reference URL: https://eusend.dev/docs/reference/api-reference Every endpoint at a glance. All endpoints are prefixed with https://api.eusend.dev. All endpoints are prefixed with `https://api.eusend.dev`. All authenticated endpoints require `Authorization: Bearer `. A machine-readable OpenAPI 3.1 description of everything on this page — request and response schemas, parameters, error codes, and a unique `operationId` per operation — is published at [`https://eusend.dev/openapi.json`](https://eusend.dev/openapi.json). Point a client generator or an LLM function-calling runtime at it rather than transcribing the tables below. ## Emails [#emails] | Method | Endpoint | Description | | ------- | -------------------- | ----------------------------------------------------- | | `POST` | `/emails` | Send a single email (schedule with `scheduled_at`) | | `POST` | `/emails/batch` | Send up to 100 emails | | `GET` | `/emails` | List emails (filter by `status`, `from`, `to`, `tag`) | | `GET` | `/emails/:id` | Get email + event history | | `PATCH` | `/emails/:id` | Reschedule a scheduled email | | `POST` | `/emails/:id/cancel` | Cancel a scheduled email | ## Suppressions [#suppressions] | Method | Endpoint | Description | | -------- | ---------------------- | ---------------------------------- | | `GET` | `/suppressions` | List suppressed addresses | | `POST` | `/suppressions` | Suppress an address | | `POST` | `/suppressions/batch` | Import up to 1,000 addresses | | `GET` | `/suppressions/export` | Download the whole list as CSV | | `DELETE` | `/suppressions/:id` | Un-suppress by entry id or address | ## Reputation [#reputation] | Method | Endpoint | Description | | ------ | ------------- | ---------------------------------------------------------------------------------- | | `GET` | `/reputation` | Bounce and complaint rates as the limits judge them, and the distance to each line | ## Templates [#templates] | Method | Endpoint | Description | | -------- | ------------------------ | ------------------------------- | | `POST` | `/templates` | Create a template | | `GET` | `/templates` | List templates | | `GET` | `/templates/:id` | Get a template | | `GET` | `/templates/:id/preview` | Render a preview with variables | | `PATCH` | `/templates/:id` | Update a template | | `DELETE` | `/templates/:id` | Delete a template | ## Broadcasts [#broadcasts] | Method | Endpoint | Description | | -------- | ------------------------ | --------------------------------------- | | `POST` | `/broadcasts` | Create a broadcast (draft) | | `GET` | `/broadcasts` | List broadcasts | | `GET` | `/broadcasts/:id` | Get broadcast | | `PATCH` | `/broadcasts/:id` | Update draft / schedule broadcast | | `POST` | `/broadcasts/:id/send` | Send, schedule, or resume broadcast | | `POST` | `/broadcasts/:id/test` | Send a test copy to your own domains | | `POST` | `/broadcasts/:id/cancel` | Cancel scheduled or in-flight broadcast | | `DELETE` | `/broadcasts/:id` | Delete a draft or cancelled broadcast | Sending to an audience with `/send` requires a paid plan; `/test` works on every plan. See [Broadcasts](/docs/broadcasts). ## Audiences [#audiences] | Method | Endpoint | Description | | -------- | -------------------------------------- | ----------------------------------- | | `POST` | `/audiences` | Create an audience | | `GET` | `/audiences` | List audiences | | `GET` | `/audiences/:id` | Get an audience | | `PATCH` | `/audiences/:id` | Rename an audience | | `DELETE` | `/audiences/:id` | Delete an audience | | `POST` | `/audiences/:id/contacts` | Add / upsert a contact | | `POST` | `/audiences/:id/contacts/batch` | Batch upsert up to 1,000 contacts | | `POST` | `/audiences/:id/contacts/batch-delete` | Delete up to 1,000 contacts by id | | `GET` | `/audiences/:id/contacts` | List contacts | | `GET` | `/audiences/:id/contacts/:contactId` | Get a contact | | `PATCH` | `/audiences/:id/contacts/:contactId` | Update contact (name, subscription) | | `DELETE` | `/audiences/:id/contacts/:contactId` | Remove a contact | ## Topics [#topics] | Method | Endpoint | Description | | -------- | --------------------------------- | --------------------------------------------- | | `POST` | `/topics` | Create a topic (name, default subscription) | | `GET` | `/topics` | List topics with subscriber counts | | `GET` | `/topics/:id` | Get a topic | | `PATCH` | `/topics/:id` | Change name, description or visibility | | `DELETE` | `/topics/:id` | Delete a topic | | `PUT` | `/topics/:id/contacts/:contactId` | Subscribe or unsubscribe a contact | | `DELETE` | `/topics/:id/contacts/:contactId` | Clear the override, back to the topic default | ## Contact properties [#contact-properties] | Method | Endpoint | Description | | -------- | ------------------------- | ----------------------------------------------- | | `POST` | `/contact-properties` | Declare a property (key, type, fallback) | | `GET` | `/contact-properties` | List declared properties | | `GET` | `/contact-properties/:id` | Get a property | | `PATCH` | `/contact-properties/:id` | Change the fallback value | | `DELETE` | `/contact-properties/:id` | Delete it, and strip the key from every contact | ## Domains [#domains] | Method | Endpoint | Description | | -------- | ----------------------------- | ------------------------------------------------- | | `POST` | `/domains` | Register a domain | | `GET` | `/domains` | List domains | | `GET` | `/domains/:id` | Get domain details | | `DELETE` | `/domains/:id` | Delete domain | | `POST` | `/domains/:id/verify` | Re-check DKIM DNS now | | `GET` | `/domains/:id/domain-connect` | Can the DNS provider publish the records for you? | ## API Keys [#api-keys] | Method | Endpoint | Description | | -------- | --------------- | ----------------- | | `POST` | `/api-keys` | Create an API key | | `GET` | `/api-keys` | List API keys | | `DELETE` | `/api-keys/:id` | Revoke an API key | `POST /api-keys` accepts `permission` (`full_access`, the default, or `sending_access`) and, on a `sending_access` key only, `domain_id` to restrict it to one sending domain. See [Authentication](/docs/getting-started/authentication) for what each permission reaches. ## Webhooks [#webhooks] | Method | Endpoint | Description | | -------- | ----------------------------- | ------------------------------- | | `POST` | `/webhooks` | Create a webhook | | `GET` | `/webhooks` | List webhooks | | `GET` | `/webhooks/:id` | Get webhook + recent deliveries | | `PATCH` | `/webhooks/:id` | Update a webhook | | `DELETE` | `/webhooks/:id` | Delete a webhook | | `GET` | `/webhooks/:id/secret` | Reveal the signing secret | | `POST` | `/webhooks/:id/rotate-secret` | Rotate the signing secret | | `POST` | `/webhooks/:id/test` | Send a test event | ## System [#system] | Method | Endpoint | Description | | ------ | --------------- | ----------------------------------------------------------------------------------- | | `GET` | `/health` | Liveness check — is the API serving? (no auth) | | `GET` | `/health/api` | Liveness check that only the API answers — tells it apart from the worker (no auth) | | `GET` | `/health/ready` | Readiness check — also proves Postgres and Valkey (no auth) | # Error Codes URL: https://eusend.dev/docs/reference/error-codes All errors follow a consistent JSON format with a human-readable message and a machine-readable code. All errors follow a consistent JSON format with a human-readable message and a machine-readable code. ```json title="error response shape" { "error": "Invalid API key", "code": "UNAUTHORIZED" } ``` | Code | Status | Description | | -------------------------------- | ------ | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `UNAUTHORIZED` | 401 | API key is missing, invalid, or revoked. | | `FORBIDDEN` | 403 | The request is not allowed for this key or this content: the API key lacks permission for the action, a domain-restricted key tried to send from another domain, or the message links to a domain that cannot be sent through eusend (the error message names it). | | `NOT_FOUND` | 404 | The requested resource does not exist. | | `VALIDATION_ERROR` | 400 | Request body failed validation. Check the error message for details. Also returned as `422` when an attachment `path` could not be fetched or a template preview failed to render. | | `CONFLICT` | 409 | Resource already exists (e.g. duplicate domain). | | `RATE_LIMITED` | 429 | Too many requests. Back off and retry. | | `DAILY_LIMIT_EXCEEDED` | 429 | Daily send ceiling reached; resets at midnight UTC. The ceiling counts recipients — every address in to, cc and bcc. On the Free plan the cap is a flat 100 recipients/day and does not change with account age. On a paid plan the ceiling is derived from your own sending and lifts as soon as you have a clean delivery record. | | `PLAN_LIMIT_EXCEEDED` | 403 | Action not allowed on your current plan (e.g. domain or contact limit reached, or sending a broadcast to an audience on the free plan). | | `DOMAIN_NOT_VERIFIED` | 403 | A domain in the request is not verified for your organisation. Usually the sender domain. Also returned when a recipient is not an inbox you control: a send from the shared sandbox domain to anyone other than your team's account emails, or a `POST /broadcasts/:id/test` recipient that is neither a team member's account email nor on one of your verified domains. | | `ALL_SUPPRESSED` | 422 | All recipient addresses are on the suppression list. | | `RECIPIENT_DOMAIN_UNDELIVERABLE` | 422 | A recipient's domain can never receive mail — it publishes no mail exchanger (no MX, an RFC 7505 null MX, and no A/AAAA to fall back on), every mail server it lists points at `localhost` or a private address or has no address at all (common on parked typo domains such as `gmaii.com`), or it is an RFC 2606 reserved name such as `example.com` or anything under `.invalid`/`.test`. Usually a typo or a documentation placeholder; when the domain looks like a typo of a common provider, the message suggests the likely one. Live sends only; test-mode keys are not checked. Nothing was sent and no quota was used. | | `SENDING_SUSPENDED` | 403 | Sending is suspended for this account, either automatically after a high bounce or complaint rate (you will have been emailed the details; see [how rates are judged](/docs/reference/rate-limits)) or after a review by eusend. Contact [support@eusend.dev](mailto:support@eusend.dev) to have it reviewed. | | `ACCOUNT_RESTRICTED` | 403 | The account is held pending review because it resembles one we have previously had to stop. Not a verdict on anything you have sent — a restricted account is held before its first send. Shared office networks, VPNs and mobile carriers all produce false matches; email [support@eusend.dev](mailto:support@eusend.dev) and a human reviews it the same day. | | `WORKSPACE_INACTIVE` | 403 | This workspace has no active subscription. Additional workspaces beyond the first one an account creates carry their own plan, and they cannot send while that plan is absent — either checkout was never completed, or the subscription has ended. Nothing is wrong with the account and no limit was exceeded; choose a plan for this workspace in Settings → Billing to activate it. Your other workspaces are unaffected. | | `SENDER_NOT_PERMITTED` | 403 | The `from` header was refused for one of two reasons. Either the display name claims to be a brand your sending domain has no relationship to (for example `Adobe Support `) — send it again with a display name that matches the domain you have verified. Or the account is temporarily limited to sender identities it has already used, in which case the message names the `from` value that was refused; existing senders keep working and [support@eusend.dev](mailto:support@eusend.dev) can add a new one. In both cases only this message was refused, not the account. | | `MONTHLY_LIMIT_EXCEEDED` | 429 | Monthly send budget reached. With metered billing off (the default) this is your monthly quota — enable it in billing settings to keep sending. With it on, this is the hard ceiling: the point at which the overage would have cost the price of the next volume up (twice your quota at the top volume, where there is no next one), which support must raise. | | `LIST_SEND_HELD` | 403 | This send goes past the 500-recipient allowance an unreviewed account has for list sending. Recipients within the allowance were delivered; the rest waits for a one-time review. Retrying will not clear it; contact [support@eusend.dev](mailto:support@eusend.dev). | | `BROADCAST_HELD` | 403 | Fan-out is paused. Either this broadcast used its unreviewed allowance and the remainder is waiting on a review — it resumes from where it stopped once cleared, and unlike a paused broadcast, sending again will not restart it — or fan-out is paused account-wide while we review recent sending, which clears on its own within a day. Transactional sends and test copies are unaffected in both cases. | | `SERVICE_PAUSED` | 503 | Sending is temporarily paused platform-wide. Retry after a short delay. | | `ATTACHMENT_STORAGE_ERROR` | 503 | An attachment could not be stored. The send did not happen — retry the request. | | `BAD_REQUEST` | 400 | The request was malformed and could not be processed. | | `PAYLOAD_TOO_LARGE` | 413 | The request body exceeds the 16 MB limit. Note that base64-encoded attachments are \~33% larger than the underlying files. | | `INTERNAL_ERROR` | 500 | An unexpected server error occurred. Retry after a short delay. | # Plans & Limits URL: https://eusend.dev/docs/reference/plans One free tier and one Production plan priced on the volume you send. Every volume includes EU-only email infrastructure, DKIM support, webhooks, and the full API. Every volume includes EU-only email infrastructure, DKIM support, webhooks, and the full API. There is one paid plan — **Production** — sold at the monthly volume you choose. Every volume gets the same API; only the allowance and a few limits move with it. Every limit on this page is **per workspace**. One account can own several — the first is free, and additional ones carry their own plan and their own invoice. See [Teams & Workspaces](/docs/teams). ## Price per volume [#price-per-volume] | Emails / month | Price | Per 1,000 | Extra emails | | --------------- | ------ | --------- | ------------- | | 3,000 (Free) | €0 | — | — | | 10,000 | €9 | €0.900 | €0.45 / 1,000 | | 25,000 | €13.50 | €0.540 | €0.45 / 1,000 | | 50,000 | €21 | €0.420 | €0.45 / 1,000 | | 100,000 | €36 | €0.360 | €0.39 / 1,000 | | 250,000 | €75 | €0.300 | €0.39 / 1,000 | | 500,000 | €140 | €0.280 | €0.33 / 1,000 | | 1,000,000 | €250 | €0.250 | €0.27 / 1,000 | | 2,000,000 | €430 | €0.215 | €0.24 / 1,000 | | Above 2,000,000 | Custom | — | — | Prices come from a single curve — a €6 monthly platform component plus €0.30 per 1,000 to 100,000, €0.26 to 500,000, €0.22 to 1,000,000, and €0.18 to 2,000,000 — so the price per thousand falls smoothly rather than in steps. Above 2,000,000 a month we quote you; email [support@eusend.dev](mailto:support@eusend.dev). ## Limits per volume [#limits-per-volume] | Emails / month | Recipients / day | Domains | Webhook endpoints | API keys | Stored contacts | Log retention | Attachment retention | | -------------- | ---------------- | --------- | ----------------- | --------------- | --------------- | ------------- | -------------------- | | 3,000 (Free) | 100 | 1 | 1 | 1 live + 1 test | 1,000 | 30 days | 30 days | | 10,000 | Usage-based | 3 | 3 | Unlimited | 5,000 | 30 days | 30 days | | 25,000 | Usage-based | 3 | 3 | Unlimited | 10,000 | 30 days | 30 days | | 50,000 | Usage-based | 5 | 3 | Unlimited | 25,000 | 30 days | 30 days | | 100,000 | Usage-based | 10 | 5 | Unlimited | 50,000 | 30 days | 30 days | | 250,000 | Usage-based | 25 | 5 | Unlimited | 100,000 | 90 days | 30 days | | 500,000 | Usage-based | 50 | 10 | Unlimited | 250,000 | 90 days | 30 days | | 1,000,000 | Usage-based | 100 | 10 | Unlimited | 500,000 | 90 days | 30 days | | 2,000,000 | Usage-based | Unlimited | 10 | Unlimited | 1,000,000 | 90 days | 30 days | Free counts live and test API keys separately, so you can keep a test key for development beside your production key. Test keys never deliver mail. The contact cap counts every contact stored across all your audiences, not per audience. Adding one past it returns `403` with code `PLAN_LIMIT_EXCEEDED`; existing contacts are never deleted when you hit it. Your daily ceiling is never lower than the contact cap on this table, so whatever list size your plan allows can be mailed in a single day. The daily limit counts recipients — every address in to, cc and bcc — while the monthly quota counts emails. The webhook cap counts registered endpoints, not deliveries. It stops at 10 rather than rising with volume because endpoints scale with the number of systems consuming your events — production, staging, an internal tool — and not with how much you send; every endpoint also receives every matching event, so the count multiplies outbound requests. Registering one past the cap returns `403` with code `PLAN_LIMIT_EXCEEDED`. The check runs on creation only: endpoints you already have keep receiving events if you move down a volume, and none are ever disabled for you. Need more than 10? Email [support@eusend.dev](mailto:support@eusend.dev). ### Extra domains [#extra-domains] On any paid volume you can add sending domains beyond the ones in the table, at €3 per domain per month, without moving up a volume. Set the number in **Settings → Billing**; you can add as many again as your volume includes — up to 6 in total at 10,000, up to 10 at 50,000. They are billed on your next invoice at the highest number you held during the month. Adding a domain past your limit never buys one for you: `POST /domains` returns `403` with code `PLAN_LIMIT_EXCEEDED` until you raise the number yourself. When you move up a volume, extra domains the new allowance covers are dropped automatically, so you are not charged for a domain your plan now includes. ### Broadcasts need a paid plan [#broadcasts-need-a-paid-plan] Sending a broadcast to an audience requires any paid volume. On Free, `POST /broadcasts/:id/send` returns `403` with code `PLAN_LIMIT_EXCEEDED`. Everything else works on Free: audiences, contacts, the editor, and `POST /broadcasts/:id/test`, which delivers the real message to your own account email or an address on a verified domain, so you can check a campaign end to end before paying. The broadcast's sender domain must be verified first. Test sends count against your daily and monthly limits like any other send. Reaching the monthly quota stops sending and returns `429` with code `MONTHLY_LIMIT_EXCEEDED`. Metered overage is opt-in per organization in **Settings → Billing**: with it on, transactional sending continues past the quota at the per-1,000 rate for your volume and the excess appears on the next invoice. That charge is **capped at the price difference to the next volume up** — going over never costs more than moving up would have — and sending pauses once the cap is reached. In practice that leaves every volume between 0.66x and 1x of its allowance in extra headroom before sending pauses. Broadcasts are excluded either way and always stop at the quota, because list mail affects shared deliverability. Log retention covers the delivery record (status, timestamps, addresses, subject, and events) and the rendered HTML and text body shown in the dashboard preview. Both expire together — for the full window everything on an email's detail page stays viewable, and after it, all of it is deleted rather than archived. Attachments are kept for 30 days at every volume, so from 250,000 up they expire before the log entry does. Past that window the entry still lists each attachment's filename, size, and content type, but the file itself is gone: the dashboard shows it as expired, and requesting it returns `410`. Paid volumes have no fixed daily number. The ceiling is derived from your own sending — never below the contact cap above, and growing with your busiest recent days — so your monthly volume is the limit that governs, not a daily one. Brand-new accounts start lower and lift as soon as they have a clean delivery record, which is a deliverability safeguard rather than a plan term: at every volume on this table the first month's capacity is more than ten times the monthly quota, so it cannot keep you from sending what you bought. [Rate Limits](/docs/reference/rate-limits) has the detail. Your volume is managed in the **Settings → Billing** section of the dashboard. Moving up takes effect immediately with prorated billing; moving down applies at the end of the billing period. # Rate Limits URL: https://eusend.dev/docs/reference/rate-limits API requests are rate-limited per organization using a sliding window algorithm. API requests are rate-limited per organization using a sliding window algorithm. | | | | ------------- | ---------------- | | **Requests** | 100 | | **Window** | 10 seconds | | **Algorithm** | Sliding window | | **Scope** | Per organization | When the rate limit is exceeded, the API returns a `429 Too Many Requests` response with error code `RATE_LIMITED`. Back off and retry after a short delay. ## Email send limits [#email-send-limits] In addition to the API rate limit, each volume has a monthly email send quota. By default, reaching it stops sending: further requests return a `429` with code `MONTHLY_LIMIT_EXCEEDED` until the quota resets at the start of the next month (UTC). ### Metered billing on overage [#metered-billing-on-overage] If you'd rather keep sending than stop, enable **metered billing** under Settings → Billing. It's off by default, so nobody is ever billed past their chosen volume without asking for it. With it on, transactional sends (`POST /emails` and `/emails/batch`) continue past your quota and the excess is billed on your next invoice: | Included | Overage | | --------- | ------------- | | 10,000 | €0.45 / 1,000 | | 25,000 | €0.45 / 1,000 | | 50,000 | €0.45 / 1,000 | | 100,000 | €0.39 / 1,000 | | 250,000 | €0.39 / 1,000 | | 500,000 | €0.33 / 1,000 | | 1,000,000 | €0.27 / 1,000 | | 2,000,000 | €0.24 / 1,000 | Each rate is 1.5x the marginal rate of the band your volume sits in, so overage always costs half as much again per email as committing to the volume would. Two things it does **not** do: * **It isn't unlimited.** Sending stops once the overage would have cost the same as the next volume up, so going over never costs more than moving up would have and a retry loop can't bill without bound. In practice that is between 0.66x and 1x your allowance in extra headroom. That ceiling returns `429` with the same `MONTHLY_LIMIT_EXCEEDED` code — the message tells you which limit you hit. * **It doesn't cover broadcasts.** List sends always stop at your monthly quota, whatever this setting says. You'll get an email the first time you cross into overage in a given month, with the rate and the ceiling. Turning the setting off stops sending at the quota again, but usage already incurred is still billed. Sustained overage always costs more than the next volume up — if you're regularly past your quota, moving up is the cheaper move. ## Daily send ceiling [#daily-send-ceiling] Your monthly volume is the limit that governs. The daily ceiling exists so that a brand-new account cannot send at full volume before it has any delivery record — a deliverability safeguard, not a plan term — and it is sized so that it cannot keep you from sending what you paid for: at every paid volume, the capacity available in your first 30 days is more than ten times the monthly quota, even if you never send a message during the first week. The ceiling counts recipients, not emails: every address in to, cc and bcc counts as one. An email to five people uses five recipients of your daily ceiling but only one email of your monthly quota. The Free plan is a flat 100 recipients/day alongside its 3,000 emails/month, and it does not change with account age. Paid accounts start at 1,000 recipients/day while routed to the new-account IP pool. That lifts as soon as you have a clean delivery record — roughly 500 delivered messages with low bounce and complaint rates on an account at least three days old, checked hourly — or after seven days, whichever comes first. Sending normally is what clears it; there is nothing to request. Once clear of the new-account pool: | Account age | Recipients / day (paid plans) | | --------------------- | ----------------------------- | | First 24 hours | 2,000 | | 1–3 days | 10,000 | | 3–7 days | 50,000 | | 7+ days (established) | Usage-based\* | \*Established accounts are bounded by a finite, usage-based ceiling — the larger of your monthly limit spread over 30 days and a multiple of your recent busy-day volume, and never below your plan's contact cap, so whatever list size your plan allows can be mailed in a single day. It grows with genuine sending but is never unlimited. Exceeding the ceiling returns a `429` with code `DAILY_LIMIT_EXCEEDED`; it resets at midnight UTC. If an account's recent bounce or complaint rate is elevated, its daily ceiling is automatically halved until the rate recovers, and sending pauses if it keeps rising. | Rate | Daily ceiling halves at | Sending pauses at | | ---------- | ----------------------- | ----------------- | | Bounces | 2% | 4% | | Complaints | 0.04% | 0.08% | Rates are measured per recipient, over the last 7 days, and only once at least 100 recipients have a delivery result. Bounces that were not about the address — a receiving server rejecting our IP, a temporary failure, a full mailbox — are not counted. Bounces are judged on the evidence rather than the raw percentage, so a handful of bad addresses cannot throttle a small sender: the rate has to be past the line with 95% confidence, from at least 5 counted bounces. If you send fewer than 1,000 recipients a week, the last 30 days are judged as well, and whichever window is worse applies. Complaints are judged on the raw rate. For its first 21 days, and while it sends fewer than 2,000 recipients a week, an account is too new for a percentage to mean much, so sending also pauses at **10 bounces**, a **10% bounce rate** over at least 20 recipients, or **2 complaints**. You get a warning email at half of either bounce line (5 bounces, or a 5% bounce rate); complaints have no warning step. Your dashboard's Overview, and [`GET /reputation`](/docs/reference/api-reference#reputation), show which bounces counted and how far you are from each line. Migrating from another provider and need full volume from day one? Email `support@eusend.dev` before you cut over and we will lift it in advance. ## List send review [#list-send-review] Transactional sending is unaffected by this section — `POST /emails` works from your first minute on a brand-new domain, up to the daily ceiling above. Sending to a **list** is different. Until we've reviewed an account, it can reach **500 recipients** across broadcasts and very large batch sends. Most first campaigns fit inside that and go out in full. Past it, the first 500 are delivered and the rest waits for a manual review — broadcasts move to `held`, and batch items beyond the allowance return `403` with code `LIST_SEND_HELD`. You'll get an email when it clears, and held broadcasts resume from exactly where they stopped. The allowance is per account, not per send, and it's a one-time step: once reviewed, it's lifted for good. Accounts sending from a domain registered in the last 30 days keep it until reviewed. We do this because every sender on eusend shares outbound IP reputation. A single list of purchased addresses degrades delivery for everyone, and a 500-recipient sample tells us how a list actually performs — real bounce and complaint rates — rather than making you wait behind a queue while we guess. On a deadline? Email `support@eusend.dev` and we'll clear it. # Go SDK URL: https://eusend.dev/docs/sdks/go Official Go SDK for the eusend API. Zero dependencies, context-aware, and shaped to mirror resend-go. Official Go SDK for the eusend API. Its shape mirrors [`resend-go`](https://github.com/resend/resend-go), so migrating from Resend is largely a `resend` → `eusend` rename. Zero dependencies (standard library only), `context.Context`-aware, and safe for concurrent use. Requires Go 1.21+. - [**Node.js / TypeScript**](/docs/sdks/nodejs) — @eusend_dev/sdk - [**Python**](/docs/sdks/python) — pip install eusend - [**Go**](/docs/sdks/go) — go get github.com/eusend-dev/eusend-go ## Installation [#installation] ```bash go get github.com/eusend-dev/eusend-go ``` ## Getting started [#getting-started] Create a client with your API key. Pass an empty string to read `EUSEND_API_KEY` from the environment. ```go import eusend "github.com/eusend-dev/eusend-go" client := eusend.NewClient("eu_live_...") // or NewClient("") to read EUSEND_API_KEY ``` Every method has a `WithContext` variant that takes a `context.Context` as its first argument (e.g. `client.Emails.SendWithContext(ctx, params)`). The context-free forms use `context.Background()`. Optional pointer fields have helpers: `eusend.Bool(true)`, `eusend.String("x")`. ## Sending an email [#sending-an-email] `From` and `To` are required; provide at least one of `Html`, `Text`, or `TemplateId`. ```go sent, err := client.Emails.Send(&eusend.SendEmailRequest{ // From accepts a bare email or a display-name form: "Acme " From: "hello@yourdomain.com", To: []string{"customer@example.com"}, Subject: "Your order is confirmed", Html: "

Thanks for your order!

", }) if err != nil { log.Fatal(err) } fmt.Println(sent.Id) // 9a8b7c6d-... ``` ### Send options [#send-options] | Field | Type | Description | | ---------------------------- | ------------------- | ------------------------------------------------------------------------------------------------------------------- | | `From` | `string` | Sender address — bare email or "Name \" | | `To` `Cc` `Bcc` `ReplyTo` | `[]string` | Max 50 each | | `Subject` | `string` | Email subject | | `Html` / `Text` | `string` | HTML / plain-text body | | `TemplateId` | `string` | ID of a saved template | | `Variables` | `map[string]any` | Template variable substitutions (HTML-escaped) | | `Headers` | `map[string]string` | Custom headers; no line breaks in names or values | | `TrackOpens` / `TrackClicks` | `*bool` | Nil uses your [organization default](/docs/tracking); `eusend.Bool(true)` to enable (default is off unless changed) | | `Attachments` | `[]*Attachment` | Up to 20, 10 MB combined. See below. | | `ScheduledAt` | `string` | Schedule for a future time, at most 30 days out | ### Attachments [#attachments] Provide `Content` (raw bytes, base64-encoded on the wire) **or** `Path` (a public URL fetched at send time). Set `ContentId` for an inline ``. ```go pdf, _ := os.ReadFile("invoice.pdf") client.Emails.Send(&eusend.SendEmailRequest{ From: "you@yourdomain.com", To: []string{"customer@example.com"}, Subject: "Your invoice", Html: "

Attached.

", Attachments: []*eusend.Attachment{ {Filename: "invoice.pdf", Content: pdf, ContentType: "application/pdf"}, }, }) ``` ### Idempotent sends [#idempotent-sends] ```go client.Emails.SendWithOptions(ctx, params, &eusend.SendEmailOptions{ IdempotencyKey: "receipt-" + orderID, }) ``` Retrying with the same key never sends a duplicate and returns the original ID. ### Batch send [#batch-send] Send up to 100 emails in a single request. Attachments and scheduling are stripped (not supported on the batch endpoint). Results map positionally to the input: queued items carry `Id`, rejected items carry `Error` and `Code`. ```go res, _ := client.Batch.Send([]*eusend.SendEmailRequest{ {From: "you@yourdomain.com", To: []string{"alice@example.com"}, Subject: "Hi", Html: "

Hi

"}, {From: "you@yourdomain.com", To: []string{"bob@example.com"}, Subject: "Hi", Html: "

Hi

"}, }) for _, r := range res.Data { if r.Id != "" { fmt.Println("queued", r.Id) } else { fmt.Printf("failed: %s (%s)\n", r.Error, r.Code) } } ``` `SendWithOptions` makes a batch safe to retry. The key is applied per item by position, so a retry must send the items in the same order. ```go client.Batch.SendWithOptions(ctx, emails, &eusend.BatchSendOptions{ IdempotencyKey: "digest-" + runID, }) ``` ### Scheduled sends [#scheduled-sends] `ScheduledAt` accepts an ISO 8601 string or natural language like `"in 1 hour"` (at most 30 days out), parsed server-side in UTC. ```go sent, _ := client.Emails.Send(&eusend.SendEmailRequest{ From: "you@yourdomain.com", To: []string{"customer@example.com"}, Subject: "Your trial ends tomorrow", Html: "

Reminder.

", ScheduledAt: "in 1 hour", }) client.Emails.Update(&eusend.UpdateEmailRequest{Id: sent.Id, ScheduledAt: "2026-07-04T09:00:00Z"}) client.Emails.Cancel(sent.Id) ``` ### Retrieve & list emails [#retrieve--list-emails] ```go email, _ := client.Emails.Get("9a8b7c6d-...") fmt.Println(email.Status, email.Events[0].Type) page, _ := client.Emails.List(&eusend.ListEmailsOptions{Status: "delivered", Limit: 50}) for _, e := range page.Data { fmt.Println(e.Id, e.Subject) } // page.NextCursor -> pass as ListEmailsOptions{Cursor: ...} for the next page ``` ## Domains [#domains] ```go created, _ := client.Domains.Create(&eusend.CreateDomainRequest{Name: "yourdomain.com"}) for _, r := range created.Records { // every DNS record to add fmt.Println(r.Type, r.Name, r.Value) } client.Domains.Verify(created.Id) // after publishing the records client.Domains.List() client.Domains.Get(created.Id) client.Domains.Remove(created.Id) ``` ## API keys [#api-keys] ```go key, _ := client.ApiKeys.Create(&eusend.CreateApiKeyRequest{Name: "Production"}) fmt.Println(key.Key) // eu_live_... — returned only once client.ApiKeys.Create(&eusend.CreateApiKeyRequest{Name: "Sandbox", TestMode: true}) // eu_test_... key // Send-only key, restricted to one domain. Omit DomainId for any verified domain. client.ApiKeys.Create(&eusend.CreateApiKeyRequest{ Name: "Billing service", Permission: eusend.PermissionSendingAccess, DomainId: domainId, }) client.ApiKeys.List() // prefixes only client.ApiKeys.Remove(key.Id) ``` ## Templates [#templates] `{{variable}}` placeholders are substituted at send time; values are HTML-escaped. ```go tpl, _ := client.Templates.Create(&eusend.CreateTemplateRequest{ Name: "Welcome email", Subject: "Welcome, {{name}}!", Html: "

Hi {{name}}

Welcome to {{product}}.

", }) client.Emails.Send(&eusend.SendEmailRequest{ From: "you@yourdomain.com", To: []string{"customer@example.com"}, TemplateId: tpl.Id, Variables: map[string]any{"name": "Jane", "product": "Acme"}, }) client.Templates.List() client.Templates.Get(tpl.Id) client.Templates.Update(tpl.Id, &eusend.UpdateTemplateRequest{Subject: eusend.String("New subject")}) html, _ := client.Templates.Preview(tpl.Id, map[string]any{"first_name": "Alex"}) // rendered HTML client.Templates.Remove(tpl.Id) ``` ## Audiences & contacts [#audiences--contacts] Contact operations are grouped under `Audiences` (they live under a specific audience). ```go audience, _ := client.Audiences.Create(&eusend.CreateAudienceRequest{Name: "Newsletter"}) client.Audiences.CreateContact(audience.Id, &eusend.CreateContactRequest{ Email: "user@example.com", FirstName: "Jane", }) // Bulk upsert (up to 1,000). Unsubscribed and CreatedAt are for migrating a list // in — an import can add an opt-out but never clear one. client.Audiences.BatchCreateContacts(audience.Id, []*eusend.CreateContactRequest{ {Email: "alice@example.com", FirstName: "Alice"}, {Email: "bob@example.com", Unsubscribed: eusend.Bool(true), CreatedAt: "2024-02-01T10:00:00Z"}, }) // Bulk delete by id (up to 1,000). Removes them from the audience — not an unsubscribe. client.Audiences.BatchDeleteContacts(audience.Id, []string{contactId}) page, _ := client.Audiences.ListContacts(audience.Id, &eusend.ListContactsOptions{ Subscribed: eusend.Bool(true), Search: "gmail.com", }) contact := page.Data[0] client.Audiences.UpdateContact(audience.Id, contact.Id, &eusend.UpdateContactRequest{ Unsubscribed: eusend.Bool(true), }) client.Audiences.GetContact(audience.Id, contact.Id) client.Audiences.RemoveContact(audience.Id, contact.Id) client.Audiences.List() client.Audiences.Get(audience.Id) // includes ContactCount client.Audiences.Update(audience.Id, &eusend.UpdateAudienceRequest{Name: "Product updates"}) client.Audiences.Remove(audience.Id) ``` ## Topics [#topics] Kinds of email a contact can subscribe to and leave independently, so an unsubscribe can be a preference change. See [Topics](/docs/audiences/topics). ```go topic, _ := client.Topics.Create(&eusend.CreateTopicRequest{ Name: "Product updates", // "opt_in" reaches everyone until they leave; "opt_out" reaches nobody until they // join. Fixed at creation. DefaultSubscription: "opt_in", Description: eusend.String("New features and changes, about once a month."), Visibility: "public", }) client.Topics.List() client.Topics.Get(topic.Id) client.Topics.Update(topic.Id, &eusend.UpdateTopicRequest{Visibility: eusend.String("private")}) // Record an explicit preference for one contact. client.Topics.Subscribe(topic.Id, contactId, true) // Forget the choice entirely, back to the topic default — not the same as false. client.Topics.ClearSubscription(topic.Id, contactId) client.Topics.Remove(topic.Id) // Scope a broadcast to it. client.Broadcasts.Create(&eusend.CreateBroadcastRequest{ Name: "October update", AudienceId: audience.Id, TopicId: topic.Id, From: "hello@acme.com", Subject: "What shipped in October", Html: "

Hi {{first_name}}…

", }) ``` ## Suppressions [#suppressions] Addresses the account will not send to. Hard bounces and spam complaints are added automatically — these methods cover the ones you manage yourself. See [Suppressions](/docs/emails/suppressions) for the full API. ```go // What's blocked, and why client.Suppressions.List(&eusend.ListSuppressionsOptions{ Reason: eusend.SuppressionReasonBounce, Limit: 50, }) client.Suppressions.List(&eusend.ListSuppressionsOptions{Email: "@acme.com"}) // Stop sending to an address. Already suppressed? The existing entry comes back // unchanged — a manual add never rewrites a real bounce or complaint. client.Suppressions.Create(&eusend.CreateSuppressionRequest{Email: "opted-out@example.com"}) // Import up to 1,000 per call — do this before your first send when migrating res, _ := client.Suppressions.Import([]*eusend.SuppressionImportItem{ {Email: "one@example.com"}, {Email: "two@example.com", Reason: eusend.SuppressionReasonComplaint}, }) fmt.Println(res.Count, res.AlreadySuppressed, res.Duplicates) // Un-suppress by entry id or by address; export the whole list as CSV client.Suppressions.Remove("invalid@example.com") csv, _ := client.Suppressions.Export() ``` ## Reputation [#reputation] Your bounce and complaint rates exactly as the sending limits judge them — what counted, what did not, and how far you are from a halved daily limit or a pause. See [how rates are judged](/docs/reference/rate-limits). Not available to sending-only keys. ```go r, err := client.Reputation.Get() if err != nil { log.Fatal(err) } fmt.Println(r.State) // healthy, warning, limited or paused if r.Next != nil && r.Next.Bounces != nil && *r.Next.Bounces <= 3 { log.Printf("%d more bounces would move this account to %s", *r.Next.Bounces, r.Next.State) } ``` ## Broadcasts [#broadcasts] `{{first_name}}`, `{{last_name}}`, `{{full_name}}`, and `{{email}}` are available per recipient, and RFC 8058 one-click unsubscribe headers are added automatically. ```go bc, _ := client.Broadcasts.Create(&eusend.CreateBroadcastRequest{ Name: "May newsletter", AudienceId: audience.Id, From: "Sivert ", Subject: "May update", Html: "

Hi {{first_name}}, your monthly update is here...

", TrackOpens: eusend.Bool(true), // omit to use your organization default }) client.Broadcasts.Test(bc.Id, &eusend.TestBroadcastRequest{To: []string{"you@yourdomain.com"}}) // preview to your own domain client.Broadcasts.Send(bc.Id, nil) // send now client.Broadcasts.Send(bc.Id, &eusend.SendBroadcastRequest{ScheduledAt: "2026-06-01T09:00:00Z"}) // or schedule client.Broadcasts.Cancel(bc.Id) client.Broadcasts.List() client.Broadcasts.Get(bc.Id) // includes delivery stats client.Broadcasts.Update(bc.Id, &eusend.UpdateBroadcastRequest{Subject: eusend.String("Updated")}) client.Broadcasts.Remove(bc.Id) ``` ## Webhooks [#webhooks] ```go hook, _ := client.Webhooks.Create(&eusend.CreateWebhookRequest{ Url: "https://yourapp.com/webhooks/eusend", Events: []string{"email.sent", "email.delivered", "email.bounced", "email.complained"}, // or: Events: []string{"*"} to receive everything }) fmt.Println(hook.Secret) // signing secret — store it securely; GetSecret reads it again client.Webhooks.List() client.Webhooks.Get(hook.Id) // includes recent deliveries client.Webhooks.Update(hook.Id, &eusend.UpdateWebhookRequest{Events: []string{"email.bounced"}}) client.Webhooks.GetSecret(hook.Id) // current signing secret client.Webhooks.RotateSecret(hook.Id) // new secret, effective immediately client.Webhooks.Remove(hook.Id) ``` ### Verifying webhook signatures [#verifying-webhook-signatures] Every delivery is signed with HMAC-SHA256 over `{webhook-id}.{webhook-timestamp}.{body}`: ```go import ( "crypto/hmac" "crypto/sha256" "encoding/base64" ) func verify(r *http.Request, body []byte, secret string) bool { signed := r.Header.Get("webhook-id") + "." + r.Header.Get("webhook-timestamp") + "." + string(body) mac := hmac.New(sha256.New, []byte(secret)) mac.Write([]byte(signed)) expected := "v1," + base64.StdEncoding.EncodeToString(mac.Sum(nil)) return hmac.Equal([]byte(r.Header.Get("webhook-signature")), []byte(expected)) } ``` ## Error handling [#error-handling] Every method returns `(result, error)`. Any non-2xx response, and any network failure, is an `*eusend.Error`. On a `429`, `RetryAfter`, `RateLimitReset`, and `RateLimitRemaining` are populated from the response headers. ```go sent, err := client.Emails.Send(params) if err != nil { var apiErr *eusend.Error if errors.As(err, &apiErr) { fmt.Println(apiErr.Code) // "MONTHLY_LIMIT_EXCEEDED" fmt.Println(apiErr.Message) // "Monthly send limit exceeded" fmt.Println(apiErr.StatusCode) // 429 (0 for a network failure) if apiErr.Code == eusend.CodeMonthlyLimitExceeded { // back off and retry later } } return } ``` | Code constant | Wire value | Status | | -------------------------- | -------------------------- | ------------------- | | `CodeUnauthorized` | `UNAUTHORIZED` | 401 | | `CodeForbidden` | `FORBIDDEN` | 403 | | `CodeNotFound` | `NOT_FOUND` | 404 | | `CodeValidationError` | `VALIDATION_ERROR` | 400 | | `CodeBadRequest` | `BAD_REQUEST` | 400 | | `CodePayloadTooLarge` | `PAYLOAD_TOO_LARGE` | 413 | | `CodeConflict` | `CONFLICT` | 409 | | `CodeRateLimited` | `RATE_LIMITED` | 429 | | `CodeMonthlyLimitExceeded` | `MONTHLY_LIMIT_EXCEEDED` | 429 | | `CodeDailyLimitExceeded` | `DAILY_LIMIT_EXCEEDED` | 429 | | `CodePlanLimitExceeded` | `PLAN_LIMIT_EXCEEDED` | 403 | | `CodeDomainNotVerified` | `DOMAIN_NOT_VERIFIED` | 403 | | `CodeSendingSuspended` | `SENDING_SUSPENDED` | 403 | | `CodeAccountRestricted` | `ACCOUNT_RESTRICTED` | 403 | | `CodeWorkspaceInactive` | `WORKSPACE_INACTIVE` | 403 | | `CodeSenderNotPermitted` | `SENDER_NOT_PERMITTED` | 403 | | `CodeListSendHeld` | `LIST_SEND_HELD` | 403 | | `CodeBroadcastHeld` | `BROADCAST_HELD` | 403 | | `CodeAllSuppressed` | `ALL_SUPPRESSED` | 422 | | `CodeServicePaused` | `SERVICE_PAUSED` | 503 | | `CodeAttachmentStorageErr` | `ATTACHMENT_STORAGE_ERROR` | 503 | | `CodeInternalError` | `INTERNAL_ERROR` | 500 | | `CodeApplicationError` | `application_error` | — (network failure) | > [!TIP] > View the full source and changelog on [GitHub](https://github.com/eusend-dev/eusend-go). # Node.js SDK URL: https://eusend.dev/docs/sdks/nodejs Official TypeScript SDK for the eusend API. Works in Node.js 18+, Bun, and any runtime with native fetch. Official TypeScript SDK for the eusend API. Works in Node.js 18+, Bun, and any runtime that supports the native `fetch` API. - [**Node.js / TypeScript**](/docs/sdks/nodejs) — @eusend_dev/sdk - [**Python**](/docs/sdks/python) — pip install eusend - [**Go**](/docs/sdks/go) — go get github.com/eusend-dev/eusend-go ## Installation [#installation] ```bash npm install @eusend_dev/sdk # or bun add @eusend_dev/sdk ``` ## Getting started [#getting-started] Create a client with your API key. The key can also be read from the `EUSEND_API_KEY` environment variable. ```ts import { Eusend } from '@eusend_dev/sdk' const client = new Eusend('eu_live_...') // or: const client = new Eusend() // reads EUSEND_API_KEY ``` ## Sending an email [#sending-an-email] Every method returns a `{ data, error, headers }` union. On success `error` is `null`; on failure `data` is `null`. ```ts const { data, error } = await client.emails.send({ from: 'hello@yourdomain.com', to: 'customer@example.com', subject: 'Your order is confirmed', html: '

Thanks for your order!

', text: 'Thanks for your order!', }) if (error) { console.error(error.name, error.message) // 'VALIDATION_ERROR' ... } else { console.log(data.id) // 9a8b7c6d-... } ``` ### Send options [#send-options] | Field | Type | Description | | ------------- | ------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `from` | `string` | Sender address — bare email or "Name \" | | `to` | `string \| string[]` | Recipient(s) | | `cc` | `string \| string[]` | CC recipient(s) | | `bcc` | `string \| string[]` | BCC recipient(s) | | `replyTo` | `string \| string[]` | Reply-to address(es) | | `subject` | `string` | Email subject | | `html` | `string` | HTML body | | `react` | `React.ReactElement` | A React Email component. The SDK renders to HTML locally before sending. Requires `react` and `@react-email/render` as peer dependencies. | | `text` | `string` | Plain text body | | `templateId` | `string` | ID of a saved template | | `variables` | `Record` | Template variable substitutions | | `headers` | `Record` | Custom email headers | | `trackOpens` | `boolean` | Track open events. Omit to use your [organization default](/docs/tracking) (off unless changed) | | `trackClicks` | `boolean` | Track click events. Omit to use your [organization default](/docs/tracking) (off unless changed) | | `attachments` | `Attachment[]` | File attachments (up to 20, 10 MB combined). Each: `{ filename, one of content (base64 string or Uint8Array) or path (a public URL fetched at send time), contentType?, contentId? }`. Set `contentId` to embed an image inline via `cid:`. | | `scheduledAt` | `string \| Date` | Schedule the send for a future time, at most 30 days out. Reschedule with `emails.update()` or cancel with `emails.cancel()` while the email is still scheduled. | At least one of `html`, `react`, `text`, or `templateId` is required. ### Send with React Email [#send-with-react-email] Pass a React Email component via `react`. The SDK renders it to HTML locally before POSTing — the JSX source never travels over the wire. ```tsx import { WelcomeEmail } from './emails/welcome' await client.emails.send({ from: 'hello@yourdomain.com', to: 'user@example.com', subject: 'Welcome', react: , }) ``` Requires `react` and `@react-email/render` as peer dependencies: `npm install react @react-email/render`. ### Idempotent sends [#idempotent-sends] Pass an `idempotencyKey` to safely retry without sending duplicates. ```ts const { data } = await client.emails.send( { from: 'you@domain.com', to: 'user@example.com', subject: 'Receipt', html: '

Thanks

' }, { idempotencyKey: `receipt-${orderId}` }, ) ``` ### Batch send [#batch-send] Send up to 100 emails in a single request. ```ts const { data } = await client.batch.send([ { from: 'you@domain.com', to: 'alice@example.com', subject: 'Hi Alice', html: '

Hi Alice

' }, { from: 'you@domain.com', to: 'bob@example.com', subject: 'Hi Bob', html: '

Hi Bob

' }, ]) console.log(data?.data) // [{ id: '9a8b7c6d-...' }, { id: '1f2e3d4c-...' }] ``` Pass an `idempotencyKey` as the second argument to retry a batch safely. The key is applied per item by position, so a retry must send the items in the same order. ```ts await client.batch.send(emails, { idempotencyKey: `digest-${runId}` }) ``` ### Scheduled sends [#scheduled-sends] Pass `scheduledAt` — a `Date`, an ISO 8601 string, or natural language like `"in 1 hour"` (at most 30 days out) — to schedule instead of sending immediately. While the email's status is `scheduled` you can move or cancel it; after that, both calls return a `409`. ```ts // Schedule for tomorrow morning const { data } = await client.emails.send({ from: 'you@domain.com', to: 'user@example.com', subject: 'Your trial ends tomorrow', html: '

Reminder: your trial ends in 24 hours.

', scheduledAt: new Date(Date.now() + 24 * 60 * 60 * 1000), }) // Reschedule await client.emails.update(data!.id, { scheduledAt: '2026-07-04T09:00:00Z', }) // Or cancel — the send is refunded to your monthly quota await client.emails.cancel(data!.id) ``` ### Retrieve & list emails [#retrieve--list-emails] ```ts // Get a single email with its delivery events const { data } = await client.emails.get('9a8b7c6d-...') console.log(data?.status) // 'delivered' console.log(data?.events) // [{ type: 'sent', ... }, ...] // List with filters const { data: list } = await client.emails.list({ status: 'delivered', limit: 50 }) console.log(list?.data) // array of emails console.log(list?.nextCursor) // pass as cursor for next page ``` ## Domains [#domains] ```ts // Add a domain and get DNS records const { data } = await client.domains.create('yourdomain.com') console.log(data?.records) // every record to publish, in order console.log(data?.dkim) // { type: 'TXT', name: 'eusend._domainkey...', value: '...' } console.log(data?.dmarc) // { type: 'TXT', name: '_dmarc...', value: '...' } // Creating the domain already starts checking DNS; this forces a fresh check await client.domains.verify(domainId) // List / get / delete await client.domains.list() await client.domains.get(domainId) await client.domains.delete(domainId) ``` ## API Keys [#api-keys] ```ts // Create a live key const { data } = await client.apiKeys.create({ name: 'Production' }) console.log(data?.key) // eu_live_... — only returned once // Create a test/sandbox key const { data: test } = await client.apiKeys.create({ name: 'Sandbox', testMode: true }) // test.key → 'eu_test_...' // Send-only key, restricted to one domain. Omit domainId for any verified domain. await client.apiKeys.create({ name: 'Billing service', permission: 'sending_access', domainId, }) await client.apiKeys.list() await client.apiKeys.delete(keyId) ``` ## Templates [#templates] ```tsx // Create an HTML template with {{variable}} placeholders const { data } = await client.templates.create({ name: 'Welcome email', subject: 'Welcome, {{name}}!', html: '

Hi {{name}}

Welcome to {{product}}.

', }) // Using React Email — SDK renders locally before sending import { OrderConfirmation } from './emails/order-confirmation' await client.templates.create({ name: 'Order confirmation', subject: 'Order {{order_id}} confirmed', react: , }) // Send using a template await client.emails.send({ from: 'you@domain.com', to: 'user@example.com', templateId: data!.id, variables: { name: 'Jane', product: 'Acme' }, }) await client.templates.list() await client.templates.get(templateId) await client.templates.update(templateId, { name: 'New name' }) const { data: html } = await client.templates.preview(templateId, { first_name: 'Alex' }) // rendered HTML await client.templates.delete(templateId) ``` ## Audiences & Contacts [#audiences--contacts] ```ts // Create an audience const { data: aud } = await client.audiences.create('Newsletter') // Add / upsert a contact await client.audiences.createContact(aud!.id, { email: 'user@example.com', firstName: 'Jane', lastName: 'Smith', }) // Bulk import (up to 1,000 per call). `unsubscribed` and `createdAt` are for // migrating a list in — an import can add an opt-out but never clear one. await client.audiences.batchCreateContacts(aud!.id, { contacts: [ { email: 'alice@example.com', firstName: 'Alice' }, { email: 'bob@example.com', unsubscribed: true, createdAt: '2024-02-01T10:00:00.000Z' }, ], }) // List with filters await client.audiences.listContacts(aud!.id, { subscribed: true, search: 'gmail.com' }) // Bulk delete by id (up to 1,000). Removes them from the audience — not an unsubscribe. await client.audiences.batchDeleteContacts(aud!.id, [contactId]) // Update / unsubscribe / delete await client.audiences.updateContact(aud!.id, contactId, { unsubscribed: true }) await client.audiences.deleteContact(aud!.id, contactId) await client.audiences.list() await client.audiences.get(aud!.id) // { id, name, createdAt, updatedAt, contactCount } await client.audiences.update(aud!.id, { name: 'Product updates' }) await client.audiences.delete(aud!.id) ``` ## Topics [#topics] Kinds of email a contact can subscribe to and leave independently, so an unsubscribe can be a preference change. See [Topics](/docs/audiences/topics). ```ts const { data: topic } = await client.topics.create({ name: 'Product updates', // 'opt_in' reaches everyone until they leave; 'opt_out' reaches nobody until they join. // Fixed at creation. defaultSubscription: 'opt_in', description: 'New features and changes, about once a month.', visibility: 'public', }) await client.topics.list() await client.topics.get(topic!.id) await client.topics.update(topic!.id, { visibility: 'private' }) // Record an explicit preference for one contact. await client.topics.subscribe(topic!.id, contactId, true) // Forget the choice entirely, back to the topic default — not the same as `false`. await client.topics.clearSubscription(topic!.id, contactId) await client.topics.delete(topic!.id) // Scope a broadcast to it. await client.broadcasts.create({ name: 'October update', audienceId: aud!.id, topicId: topic!.id, from: 'hello@acme.com', subject: 'What shipped in October', html: '

Hi {{first_name}}…

', }) ``` ## Suppressions [#suppressions] Addresses the account will not send to. Hard bounces and spam complaints are added automatically — these methods cover the ones you manage yourself. See [Suppressions](/docs/emails/suppressions) for the full API. ```ts // What's blocked, and why await client.suppressions.list({ reason: 'bounce', limit: 50 }) await client.suppressions.list({ email: '@acme.com' }) // Stop sending to an address. Already suppressed? The existing entry comes back // unchanged — a manual add never rewrites a real bounce or complaint. await client.suppressions.create({ email: 'opted-out@example.com' }) // Import up to 1,000 per call — do this before your first send when migrating await client.suppressions.import([ 'one@example.com', { email: 'two@example.com', reason: 'complaint' }, ]) // Un-suppress by entry id or by address await client.suppressions.remove('invalid@example.com') // The whole list as CSV const { data: csv } = await client.suppressions.export() ``` ## Reputation [#reputation] Your bounce and complaint rates exactly as the sending limits judge them — what counted, what did not, and how far you are from a halved daily limit or a pause. See [how rates are judged](/docs/reference/rate-limits). Not available to sending-only keys. ```ts const { data } = await client.reputation.get() // data.state: 'healthy' | 'warning' | 'limited' | 'paused' if (data?.next?.bounces != null && data.next.bounces <= 3) { console.warn(`${data.next.bounces} more bounces would move this account to ${data.next.state}`) } ``` ## Broadcasts [#broadcasts] ```tsx // Create a broadcast — HTML, a React Email component, or a saved template import { MayNewsletter } from './emails/may-newsletter' const { data } = await client.broadcasts.create({ name: 'May newsletter', audienceId: '550e8400-e29b-41d4-a716-446655440000', from: 'hello@yourdomain.com', subject: 'May update', react: , // SDK renders to HTML locally // or: html: '

Hi {{first_name}}...

' // or: templateId: '7c9e6679-7425-40de-944b-e07fc1f90ae7' }) // Check it first — delivers only to your own verified domains, leaves the // broadcast a draft, and works on the free plan (send() needs a paid one). await client.broadcasts.test(data!.id, { to: ['you@yourdomain.com'] }) // Send immediately await client.broadcasts.send(data!.id) // Or schedule for later await client.broadcasts.send(data!.id, { scheduledAt: '2026-06-01T09:00:00.000Z' }) // Cancel a scheduled broadcast await client.broadcasts.cancel(data!.id) await client.broadcasts.list() await client.broadcasts.get(broadcastId) // includes delivery stats await client.broadcasts.update(broadcastId, { subject: 'Updated subject' }) await client.broadcasts.delete(broadcastId) ``` ## Webhooks [#webhooks] ```ts // Subscribe to events const { data } = await client.webhooks.create({ url: 'https://yourapp.com/webhooks/eusend', events: ['email.sent', 'email.delivered', 'email.bounced', 'email.complained'], // or: events: ['*'] to receive everything }) console.log(data?.secret) // signing secret — store it securely; getSecret() reads it again await client.webhooks.list() await client.webhooks.get(webhookId) // includes recent deliveries await client.webhooks.update(webhookId, { events: ['email.bounced'] }) await client.webhooks.getSecret(webhookId) // { secret } await client.webhooks.rotateSecret(webhookId) // new secret, effective immediately await client.webhooks.delete(webhookId) ``` ### Verifying webhook signatures [#verifying-webhook-signatures] Every delivery is signed with HMAC-SHA256. Verify before processing: ```ts import { createHmac, timingSafeEqual } from 'crypto' async function verifyWebhook(req: Request, secret: string): Promise { const id = req.headers.get('webhook-id') ?? '' const timestamp = req.headers.get('webhook-timestamp') ?? '' const signature = req.headers.get('webhook-signature') ?? '' const body = await req.text() const expected = 'v1,' + createHmac('sha256', secret).update(`${id}.${timestamp}.${body}`).digest('base64') const received = Buffer.from(signature, 'utf8') const digest = Buffer.from(expected, 'utf8') // timingSafeEqual throws on a length mismatch — check lengths before comparing, // or a missing/truncated header crashes the handler instead of returning false. return received.length === digest.length && timingSafeEqual(received, digest) } ``` ## Error handling [#error-handling] ```ts const { data, error } = await client.emails.send({ ... }) if (error) { console.error(error.name) // 'MONTHLY_LIMIT_EXCEEDED' console.error(error.message) // 'Monthly send limit exceeded' console.error(error.statusCode) // 429 } ``` | Code | Status | Description | | -------------------------- | ------ | ------------------------------------------------------------------------------------------------------------------------------------------ | | `UNAUTHORIZED` | 401 | Invalid or missing API key | | `FORBIDDEN` | 403 | Action not allowed on your plan | | `NOT_FOUND` | 404 | Resource not found | | `VALIDATION_ERROR` | 400 | Invalid request body | | `CONFLICT` | 409 | Resource already exists | | `RATE_LIMITED` | 429 | Too many requests | | `MONTHLY_LIMIT_EXCEEDED` | 429 | Monthly send quota reached | | `DAILY_LIMIT_EXCEEDED` | 429 | Daily recipient ceiling reached — to, cc and bcc all count (resets midnight UTC) | | `PLAN_LIMIT_EXCEEDED` | 403 | Feature not available on your plan | | `DOMAIN_NOT_VERIFIED` | 403 | Sender domain is not verified | | `ALL_SUPPRESSED` | 422 | All recipients are on the suppression list | | `SENDING_SUSPENDED` | 403 | Sending is suspended for this account — contact support | | `ACCOUNT_RESTRICTED` | 403 | Account held pending review before its first send | | `WORKSPACE_INACTIVE` | 403 | This workspace has no active subscription — choose a plan for it in Settings → Billing | | `SENDER_NOT_PERMITTED` | 403 | `from` is not permitted: it impersonates a brand the sending domain does not own, or is a sender identity this account has not used before | | `LIST_SEND_HELD` | 403 | Past the unreviewed account's list-send allowance — the rest waits for review | | `BROADCAST_HELD` | 403 | Broadcast used its unreviewed allowance; the remainder waits for review | | `SERVICE_PAUSED` | 503 | Sending temporarily paused platform-wide | | `ATTACHMENT_STORAGE_ERROR` | 503 | An attachment could not be stored — retry | | `BAD_REQUEST` | 400 | Malformed request | | `PAYLOAD_TOO_LARGE` | 413 | Request body exceeds the 16 MB limit | | `INTERNAL_ERROR` | 500 | Server error | | `application_error` | null | Network failure — request never reached the server | ## TypeScript [#typescript] The SDK ships with full type definitions. All request options, response shapes, and error codes are typed. ```ts import type { SendEmailOptions, Email, EmailStatus, EusendError, EusendResponse, } from '@eusend_dev/sdk' ``` > [!TIP] > View the full source and changelog on [npm](https://www.npmjs.com/package/@eusend_dev/sdk). # Python SDK URL: https://eusend.dev/docs/sdks/python Official Python SDK for the eusend API. Zero HTTP dependencies, typed, and shaped to mirror resend-python. Official Python SDK for the eusend API. Its shape mirrors [`resend-python`](https://github.com/resend/resend-python), so migrating from Resend is largely a `resend` → `eusend` rename. Zero HTTP dependencies (built on the standard library), typed, and ships `py.typed`. Requires Python 3.8+. - [**Node.js / TypeScript**](/docs/sdks/nodejs) — @eusend_dev/sdk - [**Python**](/docs/sdks/python) — pip install eusend - [**Go**](/docs/sdks/go) — go get github.com/eusend-dev/eusend-go ## Installation [#installation] ```bash pip install eusend ``` ## Getting started [#getting-started] Configure a module-level API key, then call the resource classes directly. The key can also be read from the `EUSEND_API_KEY` environment variable. ```python import eusend eusend.api_key = 'eu_live_...' # or set EUSEND_API_KEY ``` Responses are dicts with **snake\_case** keys — access fields with `email['id']`. On failure, methods raise `eusend.EusendError` (see [Error handling](#error-handling)). ## Sending an email [#sending-an-email] `from` and `to` are required; provide at least one of `html`, `text`, or `template_id`. ```python email = eusend.Emails.send({ # `from` accepts a bare email or a display-name form: "Acme " 'from': 'hello@yourdomain.com', 'to': 'customer@example.com', 'subject': 'Your order is confirmed', 'html': '

Thanks for your order!

', 'text': 'Thanks for your order!', }) print(email['id']) # 9a8b7c6d-... ``` ### Send options [#send-options] | Key | Type | Description | | ------------------------------ | ------------------ | ---------------------------------------------------------------------------- | | `from` | `str` | Sender address — bare email or "Name \" | | `to` | `str \| list[str]` | Recipient(s), max 50 | | `cc` / `bcc` / `reply_to` | `str \| list[str]` | Max 50 each | | `subject` | `str` | Email subject | | `html` / `text` | `str` | HTML / plain-text body | | `template_id` | `str` | ID of a saved template | | `variables` | `dict` | Template variable substitutions (HTML-escaped) | | `headers` | `dict[str, str]` | Custom headers; no line breaks in names or values | | `track_opens` / `track_clicks` | `bool` | Omit to use your [organization default](/docs/tracking) (off unless changed) | | `attachments` | `list[dict]` | Up to 20, 10 MB combined. See below. | | `scheduled_at` | `str` | Schedule for a future time, at most 30 days out | At least one of `html`, `text`, or `template_id` is required. ### Attachments [#attachments] Each attachment is a dict. `content` accepts raw `bytes` (base64-encoded for you) or an already-base64 `str`; alternatively pass `path` (a public URL fetched at send time). Set `content_id` for an inline ``. ```python with open('invoice.pdf', 'rb') as f: eusend.Emails.send({ 'from': 'you@yourdomain.com', 'to': 'customer@example.com', 'subject': 'Your invoice', 'html': '

Attached.

', 'attachments': [ {'filename': 'invoice.pdf', 'content': f.read(), 'content_type': 'application/pdf'}, ], }) ``` ### Idempotent sends [#idempotent-sends] Pass an `options` dict with an `idempotency_key` to safely retry without duplicating. ```python eusend.Emails.send( {'from': 'you@yourdomain.com', 'to': 'customer@example.com', 'subject': 'Receipt', 'html': '

Thanks

'}, options={'idempotency_key': f'receipt-{order_id}'}, ) ``` ### Batch send [#batch-send] Send up to 100 emails in a single request. Attachments and scheduling are not supported on the batch endpoint and are stripped from each item. The result maps positionally to the input: queued items carry `id`, rejected items carry `error` and `code`. ```python res = eusend.Batch.send([ {'from': 'you@yourdomain.com', 'to': 'alice@example.com', 'subject': 'Hi', 'html': '

Hi

'}, {'from': 'you@yourdomain.com', 'to': 'bob@example.com', 'subject': 'Hi', 'html': '

Hi

'}, ]) for item in res['data']: print(item.get('id') or f"{item['code']}: {item['error']}") ``` Pass `options={'idempotency_key': ...}` as the second argument to retry a batch safely. The key is applied per item by position, so a retry must send the items in the same order. ```python eusend.Batch.send(emails, options={'idempotency_key': f'digest-{run_id}'}) ``` ### Scheduled sends [#scheduled-sends] `scheduled_at` accepts an ISO 8601 string or natural language like `"in 1 hour"` (at most 30 days out), parsed server-side in UTC. While the email's status is `scheduled` you can reschedule or cancel it. ```python sent = eusend.Emails.send({ 'from': 'you@yourdomain.com', 'to': 'customer@example.com', 'subject': 'Your trial ends tomorrow', 'html': '

Reminder: your trial ends in 24 hours.

', 'scheduled_at': 'in 1 hour', }) eusend.Emails.update({'id': sent['id'], 'scheduled_at': '2026-07-04T09:00:00Z'}) # reschedule eusend.Emails.cancel(sent['id']) # cancel ``` ### Retrieve & list emails [#retrieve--list-emails] ```python email = eusend.Emails.get('9a8b7c6d-...') print(email['status']) # 'delivered' print(email['events'][0]['type']) page = eusend.Emails.list({'status': 'delivered', 'limit': 50}) print(page['data']) # list of emails print(page['next_cursor']) # pass as {'cursor': ...} for next page ``` ## Domains [#domains] ```python created = eusend.Domains.create('yourdomain.com') for record in created['records']: # every DNS record to add print(record['type'], record['name'], record['value']) eusend.Domains.verify(created['id']) # after publishing the records eusend.Domains.list() eusend.Domains.get(created['id']) eusend.Domains.remove(created['id']) ``` ## API keys [#api-keys] ```python key = eusend.ApiKeys.create({'name': 'Production'}) print(key['key']) # eu_live_... — returned only once eusend.ApiKeys.create({'name': 'Sandbox', 'test_mode': True}) # eu_test_... key # Send-only key, restricted to one domain. Omit domain_id for any verified domain. eusend.ApiKeys.create({ 'name': 'Billing service', 'permission': eusend.SENDING_ACCESS, 'domain_id': domain_id, }) eusend.ApiKeys.list() # prefixes only eusend.ApiKeys.remove(key['id']) ``` ## Templates [#templates] `{{variable}}` placeholders are substituted at send time; values are HTML-escaped. ```python tpl = eusend.Templates.create({ 'name': 'Welcome email', 'subject': 'Welcome, {{name}}!', 'html': '

Hi {{name}}

Welcome to {{product}}.

', }) eusend.Emails.send({ 'from': 'you@yourdomain.com', 'to': 'customer@example.com', 'template_id': tpl['id'], 'variables': {'name': 'Jane', 'product': 'Acme'}, }) eusend.Templates.list() eusend.Templates.get(tpl['id']) eusend.Templates.update(tpl['id'], {'subject': 'New subject'}) html = eusend.Templates.preview(tpl['id'], {'first_name': 'Alex'}) # rendered HTML eusend.Templates.remove(tpl['id']) ``` ## Audiences & contacts [#audiences--contacts] Contact operations are grouped under `Audiences` (they live under a specific audience). ```python audience = eusend.Audiences.create('Newsletter') eusend.Audiences.create_contact(audience['id'], {'email': 'user@example.com', 'first_name': 'Jane'}) # Bulk upsert (up to 1,000) → {'count': N, 'duplicates': N} # unsubscribed / created_at are for migrating a list in — an import can add an # opt-out but never clear one. eusend.Audiences.batch_create_contacts(audience['id'], [ {'email': 'alice@example.com', 'first_name': 'Alice'}, {'email': 'bob@example.com', 'unsubscribed': True, 'created_at': '2024-02-01T10:00:00Z'}, ]) # Bulk delete by id (up to 1,000). Removes them from the audience — not an unsubscribe. eusend.Audiences.batch_delete_contacts(audience['id'], [contact_id]) page = eusend.Audiences.list_contacts(audience['id'], {'subscribed': True, 'search': 'gmail.com'}) contact = page['data'][0] eusend.Audiences.update_contact(audience['id'], contact['id'], {'unsubscribed': True}) eusend.Audiences.get_contact(audience['id'], contact['id']) eusend.Audiences.remove_contact(audience['id'], contact['id']) eusend.Audiences.list() eusend.Audiences.get(audience['id']) # includes contact_count eusend.Audiences.update(audience['id'], {'name': 'Product updates'}) eusend.Audiences.remove(audience['id']) ``` ## Topics [#topics] Kinds of email a contact can subscribe to and leave independently, so an unsubscribe can be a preference change. See [Topics](/docs/audiences/topics). ```python topic = eusend.Topics.create({ 'name': 'Product updates', # 'opt_in' reaches everyone until they leave; 'opt_out' reaches nobody until they # join. Fixed at creation. 'default_subscription': 'opt_in', 'description': 'New features and changes, about once a month.', 'visibility': 'public', }) eusend.Topics.list() eusend.Topics.get(topic['id']) eusend.Topics.update(topic['id'], {'visibility': 'private'}) # Record an explicit preference for one contact. eusend.Topics.subscribe(topic['id'], contact_id, True) # Forget the choice entirely, back to the topic default — not the same as False. eusend.Topics.clear_subscription(topic['id'], contact_id) eusend.Topics.remove(topic['id']) # Scope a broadcast to it. eusend.Broadcasts.create({ 'name': 'October update', 'audience_id': audience['id'], 'topic_id': topic['id'], 'from': 'hello@acme.com', 'subject': 'What shipped in October', 'html': '

Hi {{first_name}}…

', }) ``` ## Suppressions [#suppressions] Addresses the account will not send to. Hard bounces and spam complaints are added automatically — these methods cover the ones you manage yourself. See [Suppressions](/docs/emails/suppressions) for the full API. ```python # What's blocked, and why eusend.Suppressions.list({"reason": "bounce", "limit": 50}) eusend.Suppressions.list({"email": "@acme.com"}) # Stop sending to an address. Already suppressed? The existing entry comes back # unchanged — a manual add never rewrites a real bounce or complaint. eusend.Suppressions.create({"email": "opted-out@example.com"}) # Import up to 1,000 per call — do this before your first send when migrating. # (Named import_list because `import` is a Python keyword.) res = eusend.Suppressions.import_list([ "one@example.com", {"email": "two@example.com", "reason": "complaint"}, ]) print(res["count"], res["already_suppressed"], res["duplicates"]) # Un-suppress by entry id or by address; export the whole list as CSV bytes eusend.Suppressions.remove("invalid@example.com") csv = eusend.Suppressions.export() ``` ## Reputation [#reputation] Your bounce and complaint rates exactly as the sending limits judge them — what counted, what did not, and how far you are from a halved daily limit or a pause. See [how rates are judged](/docs/reference/rate-limits). Not available to sending-only keys. ```python r = eusend.Reputation.get() print(r["state"]) # healthy, warning, limited or paused nxt = r["next"] if nxt and nxt["bounces"] is not None and nxt["bounces"] <= 3: print(f"{nxt['bounces']} more bounces would move this account to {nxt['state']}") ``` ## Broadcasts [#broadcasts] `{{first_name}}`, `{{last_name}}`, `{{full_name}}`, and `{{email}}` are available per recipient, and RFC 8058 one-click unsubscribe headers are added automatically. ```python bc = eusend.Broadcasts.create({ 'name': 'May newsletter', 'audience_id': audience['id'], 'from': 'Sivert ', 'subject': 'May update', 'html': '

Hi {{first_name}}, your monthly update is here...

', }) eusend.Broadcasts.test(bc['id'], {'to': ['you@yourdomain.com']}) # preview to your own domain eusend.Broadcasts.send(bc['id']) # send now eusend.Broadcasts.send(bc['id'], {'scheduled_at': '2026-06-01T09:00:00Z'}) # or schedule eusend.Broadcasts.cancel(bc['id']) eusend.Broadcasts.list() eusend.Broadcasts.get(bc['id']) # includes delivery stats eusend.Broadcasts.update(bc['id'], {'subject': 'Updated subject'}) eusend.Broadcasts.remove(bc['id']) ``` ## Webhooks [#webhooks] ```python hook = eusend.Webhooks.create({ 'url': 'https://yourapp.com/webhooks/eusend', 'events': ['email.sent', 'email.delivered', 'email.bounced', 'email.complained'], # or: 'events': ['*'] to receive everything }) print(hook['secret']) # signing secret — store it securely; get_secret reads it again eusend.Webhooks.list() eusend.Webhooks.get(hook['id']) # includes recent deliveries eusend.Webhooks.update(hook['id'], {'events': ['email.bounced']}) eusend.Webhooks.get_secret(hook['id']) # {'secret': ...} eusend.Webhooks.rotate_secret(hook['id']) # new secret, effective immediately eusend.Webhooks.remove(hook['id']) ``` ### Verifying webhook signatures [#verifying-webhook-signatures] Every delivery is signed with HMAC-SHA256 over `{webhook-id}.{webhook-timestamp}.{body}`: ```python import base64 import hashlib import hmac def verify(headers, body: bytes, secret: str) -> bool: signed = f"{headers['webhook-id']}.{headers['webhook-timestamp']}.{body.decode()}" mac = hmac.new(secret.encode(), signed.encode(), hashlib.sha256) expected = 'v1,' + base64.b64encode(mac.digest()).decode() return hmac.compare_digest(headers['webhook-signature'], expected) ``` ## Error handling [#error-handling] Any non-2xx response raises a subclass of `eusend.EusendError`. Network failures that never reach the server raise `ApplicationError` (with `status_code == None`). Branch on `e.code`. ```python import eusend from eusend import EusendError, RateLimitError try: eusend.Emails.send({'from': 'you@yourdomain.com', 'to': 'customer@example.com', 'subject': 'Hi', 'html': '

Hi

'}) except RateLimitError as e: print(e.code) # 'MONTHLY_LIMIT_EXCEEDED' print(e.status_code) # 429 except EusendError as e: print(e.code, e.message, e.status_code) ``` Exception classes — all subclasses of `EusendError`: `MissingApiKeyError`, `InvalidApiKeyError`, `ValidationError`, `NotFoundError`, `RateLimitError`, `ApplicationError`. | Code | Status | Exception | | ---------------------------------- | ------ | ------------------------------------ | | `UNAUTHORIZED` | 401 | `InvalidApiKeyError` | | `FORBIDDEN` | 403 | `EusendError` | | `NOT_FOUND` | 404 | `NotFoundError` | | `VALIDATION_ERROR` / `BAD_REQUEST` | 400 | `ValidationError` | | `PAYLOAD_TOO_LARGE` | 413 | `ValidationError` | | `CONFLICT` | 409 | `EusendError` | | `RATE_LIMITED` | 429 | `RateLimitError` | | `MONTHLY_LIMIT_EXCEEDED` | 429 | `RateLimitError` | | `DAILY_LIMIT_EXCEEDED` | 429 | `RateLimitError` | | `PLAN_LIMIT_EXCEEDED` | 403 | `EusendError` | | `DOMAIN_NOT_VERIFIED` | 403 | `EusendError` | | `ALL_SUPPRESSED` | 422 | `EusendError` | | `SENDING_SUSPENDED` | 403 | `EusendError` | | `ACCOUNT_RESTRICTED` | 403 | `EusendError` | | `WORKSPACE_INACTIVE` | 403 | `EusendError` | | `SENDER_NOT_PERMITTED` | 403 | `ValidationError` | | `LIST_SEND_HELD` | 403 | `EusendError` | | `BROADCAST_HELD` | 403 | `EusendError` | | `SERVICE_PAUSED` | 503 | `EusendError` | | `ATTACHMENT_STORAGE_ERROR` | 503 | `EusendError` | | `INTERNAL_ERROR` | 500 | `ApplicationError` | | `application_error` | — | `ApplicationError` (network failure) | > [!TIP] > View the full source and changelog on [GitHub](https://github.com/eusend-dev/eusend-python). # Claude Code plugin URL: https://eusend.dev/docs/skill Install the official eusend plugin so Claude knows how eusend actually behaves — verified senders, idempotent retries, webhook signatures, and which errors to retry — before it writes a line of code. The [MCP server](/docs/mcp) gives an assistant tools: it can send mail, add a domain, read your delivery log. What it can't do is tell the assistant how eusend *behaves* — that the sender domain must be verified, that a retry without an `Idempotency-Key` double-sends, that a webhook signature covers the raw request body and not the parsed JSON. That's what a **skill** is for. The eusend plugin ships one, plus the MCP server, in a single install. ## Install [#install] ```bash title="shell" /plugin marketplace add eusend-dev/eusend-skill /plugin install eusend@eusend ``` Then set your API key so the bundled MCP server can authenticate: ```bash title="shell" export EUSEND_API_KEY=eu_live_xxxxxxxxxxxx export EUSEND_FROM=hello@yourdomain.com # optional — pins a default sender ``` > [!NOTE] > The skill itself needs no key. Only the MCP server does. Use an `eu_test_` key while you're wiring > things up — sends are accepted, recorded, and fire the full webhook lifecycle, but never reach a > real inbox. ## Using it [#using-it] Claude loads the skill on its own when a task involves eusend — a `@eusend_dev/sdk` import, an `EUSEND_API_KEY` in your env file, or just a prompt that mentions us. To invoke it directly, type `/eusend:eusend`. Things it's built for: ```text Add password reset emails to this app using eusend Why is this send returning DOMAIN_NOT_VERIFIED? Write a webhook handler for eusend bounces Set up the DNS records for acme.com ``` ## What it knows [#what-it-knows] The skill is written around the mistakes that actually reach production, not a restatement of the API reference: | Parameter | Type | Description | | --- | --- | --- | | `Verified senders` | `DOMAIN_NOT_VERIFIED` | The from address must be on a verified domain, and no retry fixes it. Includes the sandbox sender and its one real constraint — it only delivers to your own account email. | | `Idempotent retries` | `Idempotency-Key` | Derive the key from a domain object, not a UUID minted per attempt — which is the version that makes every retry a fresh send. | | `Webhook signatures` | `raw body` | Verify against the bytes received, in constant time, checking length first. Working handlers for Express, Next.js route handlers, Flask, and net/http. | | `The SPF record not to add` | `DNS` | A second SPF record on your root domain breaks SPF for every other service sending from it, including your own Google Workspace mail. eusend authenticates with DKIM and does not need one. | | `Retry policy` | `error codes` | Which codes are transient, which need a longer horizon, and which are terminal. ALL_SUPPRESSED is the system working, not an incident. | | `Per-language failure shapes` | `SDKs` | The Node SDK returns { data, error } and never throws on an API error — an unchecked await silently drops every failed send. Python raises; Go returns an error. | Detail lives in reference files the assistant loads only when it needs them, so the always-on cost is about 260 tokens. ## Other agents [#other-agents] [Agent Skills](https://agentskills.io) is an open standard, not a Claude format. This skill is written to it — spec-standard frontmatter only, no Claude-specific syntax in the body — so it works in Cursor, GitHub Copilot, VS Code, Codex, Gemini CLI, OpenCode, Goose, Amp, Roo Code and the rest of the skills-compatible ecosystem. Only the install differs. `/plugin` is Claude Code's marketplace format; elsewhere you drop the skill folder somewhere the agent scans. Cursor, Codex and Copilot all read `.agents/skills/`, so one copy covers all three: ```bash title="shell" git clone https://github.com/eusend-dev/eusend-skill mkdir -p .agents/skills cp -r eusend-skill/plugins/eusend/skills/eusend .agents/skills/ ``` Use `~/.agents/skills/` to install it once for every project instead. Agents that scan elsewhere — `.github/skills/` for Copilot, `.cursor/skills/` for Cursor — work the same way. > [!NOTE] > The [MCP server](/docs/mcp) is independent of the skill and equally portable — it speaks plain > MCP, so Cursor, Codex, Claude Desktop and any other MCP client can connect to it. Only the > bundled-in-one-install convenience is specific to Claude Code. > [!TIP] > Found something the skill gets wrong? That's a bug, and the repository takes issues. A skill that > confidently teaches the wrong thing is worse than no skill at all. # SMTP URL: https://eusend.dev/docs/smtp Send through eusend over SMTP instead of the HTTP API — a drop-in transport for anything that already speaks SMTP, from WordPress and Supabase to Django, Laravel, and Rails. Send through eusend over SMTP instead of the HTTP API — a drop-in transport for anything that already speaks SMTP: WordPress, Supabase Auth, Django, Laravel, Rails, Ghost, and most off-the-shelf software. Messages submitted over SMTP run through the exact same pipeline as the API, so DKIM signing, open and click tracking, suppression, and your sending limits all apply identically. ## Connection settings [#connection-settings] | Parameter | Type | Description | | --- | --- | --- | | `Host` (required) | `smtp.eusend.dev` | The SMTP submission server. | | `Port` (required) | `465` | Implicit TLS (SMTPS) — the connection is encrypted from the first byte. STARTTLS (587) and plain SMTP (25) are not supported. | | `Security` (required) | `SSL / TLS` | Implicit TLS on 465. Not STARTTLS. Choose "SSL" or "TLS" if your client asks. | | `Username` (required) | `eusend` | Always the literal string "eusend" — not your email address and not your key. | | `Password` (required) | `eu_live_… / eu_test_…` | Any of your eusend API keys. The key goes in the password field. | > [!WARNING] > The username is always the literal word `eusend`; your API key goes in the **password** field. > Putting the key in the username is the most common cause of a `535` authentication failure. ## Integration guides [#integration-guides] Step-by-step setup for the most common platforms. Every one uses the same host, port, username, and password above — only the location of the settings screen differs. - [**WordPress**](/docs/smtp/wordpress) — WP Mail SMTP / FluentSMTP - [**Supabase Auth**](/docs/smtp/supabase) — Custom SMTP for auth emails - [**Django**](/docs/smtp/django) — EMAIL_BACKEND settings - [**Laravel**](/docs/smtp/laravel) — config/mail.php + .env - [**Ruby on Rails**](/docs/smtp/rails) — Action Mailer delivery - [**Nodemailer**](/docs/smtp/nodemailer) — Node.js transport - [**Ghost**](/docs/smtp/ghost) — Transactional mail config - [**PHP (PHPMailer)**](/docs/smtp/phpmailer) — Plain PHP sending ## The sender address [#the-sender-address] The message `From` address must use a domain you have verified in eusend — the same rule as the API. Mail from an unverified domain is rejected at submission with a `535` carrying the reason in its text. The local part (before the `@`) can be anything. See [Domain Setup](/docs/domains) to add and verify a domain. ## Test and live keys [#test-and-live-keys] A key prefixed `eu_test_` is accepted and tracked but never delivered — ideal while you wire up an integration. Swap in an `eu_live_` key to send for real. ## Quick check — swaks (CLI) [#quick-check--swaks-cli] Before wiring SMTP into an application, confirm your key and sender domain work with a one-line send from the terminal: ```bash title="shell" swaks \ --server smtp.eusend.dev:465 --tlsc \ --auth-user eusend --auth-password eu_live_xxxxxxxxxxxx \ --from hello@yourdomain.com \ --to alice@example.com \ --header 'Subject: SMTP test' \ --body 'Hello from eusend over SMTP.' ``` ## Limits and behavior [#limits-and-behavior] | Parameter | Type | Description | | --- | --- | --- | | `Recipients` | `max 50 each` | Up to 50 addresses each across To, Cc, and Bcc. | | `Message size` | `max 15 MB` | The whole message on the wire, MIME encoding included. Larger messages are rejected with a 552. | | `Attachments` | `max 20, 10 MB` | Up to 20 attachments, 10 MB combined once decoded — the same limits as the API. Over either one, the message is rejected with a 552 rather than delivered without the files. | | `Sending limits` | `shared` | The same rate limit, monthly plan limit, and progressive daily sending ceiling as the HTTP API apply to SMTP submissions. | | `Tracking & events` | `identical` | Opens, clicks, bounces, complaints, and suppression all apply — an SMTP send appears in your dashboard and analytics like any other email. | ## Troubleshooting [#troubleshooting] | Parameter | Type | Description | | --- | --- | --- | | `535` | `auth or sender rejected` | Wrong username or invalid key — the username must be the literal "eusend" and the API key goes in the password field. An unverified From domain also lands here, so read the response text before assuming the credentials are wrong. | | `550` | `rejected` | The message itself was refused — every recipient is on your suppression list, or the content failed validation. | | `452` | `rate limited` | A rate limit, your daily sending ceiling, or your monthly quota was hit. Retry later — the response text says which; a monthly quota does not clear until the month resets or you raise it. | | `421` | `temporary` | Temporary server error or too many simultaneous connections — retry with backoff. | # Django SMTP URL: https://eusend.dev/docs/smtp/django Configure Django's email backend to send through eusend over SMTP — password resets, notifications, and any send_mail call, DKIM-signed and tracked. Django's SMTP email backend works with eusend out of the box — no extra packages. Set five settings and every `send_mail`, `EmailMessage`, password-reset, and `django.contrib.auth` email routes through eusend, DKIM-signed and tracked. ## settings.py [#settingspy] ```python title="settings.py" EMAIL_BACKEND = 'django.core.mail.backends.smtp.EmailBackend' EMAIL_HOST = 'smtp.eusend.dev' EMAIL_PORT = 465 EMAIL_USE_SSL = True # implicit TLS — not EMAIL_USE_TLS EMAIL_HOST_USER = 'eusend' # always the literal string "eusend" EMAIL_HOST_PASSWORD = os.environ['EUSEND_API_KEY'] # eu_live_… # Must be an address on a domain verified in eusend DEFAULT_FROM_EMAIL = 'Acme ' ``` > [!WARNING] > Use `EMAIL_USE_SSL = True` (implicit TLS on port 465), **not** `EMAIL_USE_TLS`. Setting both > raises `ValueError: EMAIL_USE_TLS/EMAIL_USE_SSL are mutually exclusive`. ## Send an email [#send-an-email] ```python from django.core.mail import send_mail send_mail( subject='Your order has shipped', message='Order #1234 is on its way.', from_email=None, # falls back to DEFAULT_FROM_EMAIL recipient_list=['alice@example.com'], html_message='

Order #1234 is on its way.

', ) ``` Test it from the shell without touching a view: ```bash python manage.py shell -c "from django.core.mail import send_mail; \ send_mail('Test', 'Body', None, ['you@example.com'])" ``` ## Connection reference [#connection-reference] | Setting | Value | | --------------------- | ------------------------------------------------ | | `EMAIL_HOST` | `smtp.eusend.dev` | | `EMAIL_PORT` | `465` | | `EMAIL_USE_SSL` | `True` | | `EMAIL_HOST_USER` | `eusend` | | `EMAIL_HOST_PASSWORD` | your eusend API key (`eu_live_…`) | | `DEFAULT_FROM_EMAIL` | an address on a [verified domain](/docs/domains) | Use an `eu_test_` key while developing — sends are accepted and tracked but never delivered. See the [SMTP overview](/docs/smtp) for limits and status codes. ## Troubleshooting [#troubleshooting] | Symptom | Cause and fix | | ------------------------------------------------------------------------------------------------ | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `EMAIL_USE_TLS/EMAIL_USE_SSL are mutually exclusive, so only set one of those settings to True.` | Both settings are `True`. eusend uses implicit TLS, so keep `EMAIL_USE_SSL = True` and remove `EMAIL_USE_TLS` or set it to `False`. | | The send hangs, then `SMTPServerDisconnected: Connection unexpectedly closed` or a timeout | `EMAIL_USE_TLS = True` makes Django start a plaintext session and ask for STARTTLS, which port 465 does not speak. Use `EMAIL_USE_SSL = True` with `EMAIL_PORT = 465`. | | `SMTPAuthenticationError: (535, …)` | Read the response text. `Invalid credentials` means the username is not the literal `eusend` or the API key is wrong. A message naming a domain means the From address is on a domain you have not [verified](/docs/domains). | | `535 Too many failed attempts` or `421 Connection rejected` | Repeated failed logins block your IP address for up to an hour. Fix the credentials, then wait before retrying. | | Nothing arrives and no error is raised | `EMAIL_BACKEND` is still the console or file backend, so mail is printed or written to disk instead of sent. Set it to `django.core.mail.backends.smtp.EmailBackend`. With an `eu_test_` key the send is accepted and shown in the dashboard but never delivered. | | Connection times out | Your host blocks outbound port 465, or the port is set to 587 or 25. eusend only accepts SMTP on 465. Ask your host to open it, or send through the [HTTP API](/docs/emails/send). | See the [SMTP overview](/docs/smtp#troubleshooting) for the full status-code table. # Ghost SMTP URL: https://eusend.dev/docs/smtp/ghost Configure your Ghost blog to send transactional email — member sign-in links, password resets, staff invites — through eusend over SMTP. Ghost sends two kinds of email: bulk newsletters (which require Mailgun) and transactional mail — member sign-in links, password resets, and staff invites. eusend handles the transactional mail through Ghost's `mail` SMTP configuration, DKIM-signed and tracked. ## config.production.json [#configproductionjson] Ghost is configured through its config file (or the equivalent environment variables). Add a `mail` block: ```json title="config.production.json" { "mail": { "transport": "SMTP", "from": "Acme ", "options": { "host": "smtp.eusend.dev", "port": 465, "secure": true, "auth": { "user": "eusend", "pass": "eu_live_xxxxxxxxxxxx" } } } } ``` The `from` address must be on a domain you have [verified in eusend](/docs/domains). ## As environment variables [#as-environment-variables] If you run Ghost via Docker or a managed host, the same settings map to environment variables: ```ini mail__transport=SMTP mail__from=no-reply@yourdomain.com mail__options__host=smtp.eusend.dev mail__options__port=465 mail__options__secure=true mail__options__auth__user=eusend mail__options__auth__pass=eu_live_xxxxxxxxxxxx ``` Restart Ghost after changing the config. > [!WARNING] > Keep `"secure": true` with port `465` (implicit TLS). Ghost's mail transport is Nodemailer under > the hood, so `secure: false` would attempt STARTTLS on the wrong port and fail. ## Verify [#verify] In Ghost admin, go to **Settings → Staff** and send yourself an invite, or trigger a member sign-in link — both are transactional and go through eusend. The message appears in your eusend dashboard. > [!NOTE] > Ghost still requires Mailgun specifically for **bulk newsletter** sending — that path is separate > from transactional mail and is not configurable to other providers. eusend covers everything under > the `mail` block above. ## Troubleshooting [#troubleshooting] | Symptom | Cause and fix | | ----------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `Invalid login: 535 …` in the Ghost log | Read the response text. `Invalid credentials` means the username is not the literal `eusend` or the API key is wrong. A message naming a domain means the From address is on a domain you have not [verified](/docs/domains). | | `Greeting never received` | `secure` is `false` or missing, so Ghost waits for a plaintext greeting on a TLS port. Set `"secure": true` with `"port": 465`. | | `Connection timeout` | Your host blocks outbound port 465, or the port is set to 587 or 25. eusend only accepts SMTP on 465. Ask your host to open it. | | `535 Too many failed attempts` or `421 Connection rejected` | Repeated failed logins block your IP address for up to an hour. Fix the credentials, then wait before retrying. | | Config changes have no effect | Ghost reads its config at startup. Restart it, and check you edited the file for the environment Ghost runs in (`config.production.json` in production). | | Sign-in links work, newsletters do not | Expected — newsletters go through Ghost's separate bulk-email setting, which only supports Mailgun. | See the [SMTP overview](/docs/smtp#troubleshooting) for the full status-code table. # Laravel SMTP URL: https://eusend.dev/docs/smtp/laravel Set up Laravel's mail configuration to send through eusend over SMTP — Mailables, notifications, and queued mail, DKIM-signed and tracked. Laravel ships with an SMTP mail transport, so sending through eusend is a matter of environment variables — no package to install. Every `Mail::send`, Mailable, and notification then routes through eusend, DKIM-signed and tracked. ## .env [#env] ```ini title=".env" MAIL_MAILER=smtp MAIL_SCHEME=smtps # implicit TLS on 465 MAIL_HOST=smtp.eusend.dev MAIL_PORT=465 MAIL_USERNAME=eusend # always the literal string "eusend" MAIL_PASSWORD=eu_live_xxxxxxxxxxxx MAIL_FROM_ADDRESS=no-reply@yourdomain.com # must be a verified domain MAIL_FROM_NAME="Acme" ``` `config/mail.php` already reads these variables — no edit needed there. > [!WARNING] > `MAIL_SCHEME` takes `smtps` (implicit TLS, port `465`) — not `ssl` or `tls`. STARTTLS on 587 is > not supported. ### Older Laravel versions [#older-laravel-versions] Laravel 12 and later read `MAIL_SCHEME`. If your `config/mail.php` has an `encryption` key instead of `scheme` — Laravel 10 and earlier, and Laravel 11 apps that kept their original config — set `MAIL_ENCRYPTION=ssl` in place of `MAIL_SCHEME=smtps`. Everything else is the same. ## Send an email [#send-an-email] ```php use Illuminate\Support\Facades\Mail; Mail::raw('Order #1234 is on its way.', function ($message) { $message->to('alice@example.com') ->subject('Your order has shipped'); }); ``` After editing `.env`, clear the cached config so the new values take effect: ```bash php artisan config:clear ``` ## Connection reference [#connection-reference] | Variable | Value | | ------------------- | ------------------------------------------------ | | `MAIL_HOST` | `smtp.eusend.dev` | | `MAIL_PORT` | `465` | | `MAIL_SCHEME` | `smtps` (`MAIL_ENCRYPTION=ssl` on older apps) | | `MAIL_USERNAME` | `eusend` | | `MAIL_PASSWORD` | your eusend API key (`eu_live_…`) | | `MAIL_FROM_ADDRESS` | an address on a [verified domain](/docs/domains) | Use an `eu_test_` key while building — sends are tracked but not delivered. See the [SMTP overview](/docs/smtp) for limits and status codes. ## Troubleshooting [#troubleshooting] | Symptom | Cause and fix | | ---------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `The "ssl" scheme is not supported; supported schemes for mailer "smtp" are: "smtp", "smtps".` | `MAIL_SCHEME` only accepts `smtp` or `smtps`. Set `MAIL_SCHEME=smtps`. The same error names `tls` if that is what you set. | | `Failed to authenticate on SMTP server with username "eusend"` | Read the response text. `Invalid credentials` means the username is not the literal `eusend` or the API key is wrong. A message naming a domain means the From address is on a domain you have not [verified](/docs/domains). | | `Connection could not be established with host "ssl://smtp.eusend.dev:465"` | Your host blocks outbound port 465. There is no alternate port — ask your host to open it, or send through the [HTTP API](/docs/emails/send). | | The send hangs, then times out | `MAIL_PORT` is 587 or 25, or `MAIL_SCHEME=smtp` on port 465. eusend only accepts implicit TLS on 465. | | `535 Too many failed attempts` or `421 Connection rejected` | Repeated failed logins block your IP address for up to an hour. Fix the credentials, then wait before retrying. | | New `.env` values are ignored | The config is cached. Run `php artisan config:clear` (and restart queue workers, which keep the old config in memory). | | Nothing arrives and no error is raised | `MAIL_MAILER` is still `log`, the default in a new app, so mail is written to `storage/logs/laravel.log`. Queued mail also needs `php artisan queue:work` running. | See the [SMTP overview](/docs/smtp#troubleshooting) for the full status-code table. # Nodemailer SMTP URL: https://eusend.dev/docs/smtp/nodemailer Send email from Node.js through eusend with Nodemailer over SMTP — implicit TLS on port 465, DKIM-signed and tracked. Nodemailer is the standard way to send email from Node.js. Point its SMTP transport at eusend and every message is DKIM-signed, tracked, and subject to the same limits as the HTTP API. ## Install [#install] ```bash npm install nodemailer ``` ## Transport [#transport] ```ts title="mailer.ts" import nodemailer from 'nodemailer' export const transport = nodemailer.createTransport({ host: 'smtp.eusend.dev', port: 465, secure: true, // implicit TLS — encrypted from the first byte auth: { user: 'eusend', // always the literal string "eusend" pass: process.env.EUSEND_API_KEY, // eu_live_… }, }) ``` > [!WARNING] > `secure: true` selects implicit TLS on port 465. Do not set `secure: false` (that expects STARTTLS > on 587, which eusend does not support). ## Send an email [#send-an-email] ```ts await transport.sendMail({ from: 'Acme ', // must be a verified domain to: 'alice@example.com', subject: 'Your order has shipped', html: '

Order #1234 is on its way.

', text: 'Order #1234 is on its way.', }) ``` Attachments, `cc`, `bcc`, `replyTo`, and custom `headers` all work as usual — Nodemailer builds the MIME message and eusend relays it. To [tag](/docs/emails/tags) a relayed send for log filtering and webhook routing, add an `X-Eusend-Tag` header: ```ts await transport.sendMail({ from: 'Acme ', to: 'alice@example.com', subject: 'Reset your password', html: '

Here is your reset link.

', headers: { 'X-Eusend-Tag': 'category=password_reset, tier=pro' }, }) ``` ## Verify the connection [#verify-the-connection] ```ts await transport.verify() // resolves if the host, port, and auth are correct ``` ## Connection reference [#connection-reference] | Option | Value | | ----------- | ------------------------------------------------ | | `host` | `smtp.eusend.dev` | | `port` | `465` | | `secure` | `true` | | `auth.user` | `eusend` | | `auth.pass` | your eusend API key (`eu_live_…`) | | `from` | an address on a [verified domain](/docs/domains) | > [!NOTE] > For a richer typed API — batch sends, scheduling, templates, idempotency — use the [Node.js > SDK](/docs/sdks/nodejs) over the HTTP API instead. SMTP is best when a library or framework > already speaks it. ## Troubleshooting [#troubleshooting] | Symptom | Cause and fix | | ----------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `Error: Invalid login: 535 …` (`EAUTH`) | Read the response text. `Invalid credentials` means the username is not the literal `eusend` or the API key is wrong. A message naming a domain means the From address is on a domain you have not [verified](/docs/domains). | | `Error: Greeting never received` (`ETIMEDOUT`) | `secure` is `false`, so Nodemailer waits for a plaintext greeting on a TLS port. Set `secure: true` with `port: 465`. | | `Error: Connection timeout` (`ETIMEDOUT`) | Your host blocks outbound port 465, or the port is set to 587 or 25. eusend only accepts SMTP on 465. Ask your host to open it, or send through the [HTTP API](/docs/emails/send). | | `535 Too many failed attempts` or `421 Connection rejected` | Repeated failed logins block your IP address for up to an hour. Fix the credentials, then wait before retrying. | | `pass` is `undefined` | `EUSEND_API_KEY` is not set in the environment the process runs in. Nodemailer then fails the login with a 535. | | Send rejected with `452` | A rate limit or your daily sending ceiling was hit. Retry later, and reuse one transport with `pool: true` rather than opening a connection per message. | See the [SMTP overview](/docs/smtp#troubleshooting) for the full status-code table. # PHP (PHPMailer) SMTP URL: https://eusend.dev/docs/smtp/phpmailer Send email from plain PHP through eusend using PHPMailer over SMTP — implicit TLS on port 465, DKIM-signed and tracked. For a PHP app without a framework, [PHPMailer](https://github.com/PHPMailer/PHPMailer) is the standard SMTP client. Point it at eusend and your mail is DKIM-signed, tracked, and subject to the same limits as the HTTP API. ## Install [#install] ```bash composer require phpmailer/phpmailer ``` ## Send an email [#send-an-email] ```php title="send.php" use PHPMailer\PHPMailer\PHPMailer; use PHPMailer\PHPMailer\Exception; require 'vendor/autoload.php'; $mail = new PHPMailer(true); try { $mail->isSMTP(); $mail->Host = 'smtp.eusend.dev'; $mail->SMTPAuth = true; $mail->Username = 'eusend'; // the literal string "eusend" $mail->Password = getenv('EUSEND_API_KEY'); // eu_live_… $mail->SMTPSecure = PHPMailer::ENCRYPTION_SMTPS; // implicit TLS $mail->Port = 465; // From must be on a domain verified in eusend $mail->setFrom('no-reply@yourdomain.com', 'Acme'); $mail->addAddress('alice@example.com'); $mail->isHTML(true); $mail->Subject = 'Your order has shipped'; $mail->Body = '

Order #1234 is on its way.

'; $mail->AltBody = 'Order #1234 is on its way.'; $mail->send(); } catch (Exception $e) { echo "Send failed: {$mail->ErrorInfo}"; } ``` > [!WARNING] > Use `ENCRYPTION_SMTPS` with port `465` (implicit TLS), **not** `ENCRYPTION_STARTTLS`. STARTTLS on > 587 is not supported. ## Connection reference [#connection-reference] | Property | Value | | ------------ | ------------------------------------------------ | | `Host` | `smtp.eusend.dev` | | `Port` | `465` | | `SMTPSecure` | `PHPMailer::ENCRYPTION_SMTPS` | | `Username` | `eusend` | | `Password` | your eusend API key (`eu_live_…`) | | `setFrom()` | an address on a [verified domain](/docs/domains) | Use an `eu_test_` key while developing — sends are tracked but not delivered. See the [SMTP overview](/docs/smtp) for limits and status codes. ## Troubleshooting [#troubleshooting] | Symptom | Cause and fix | | ------------------------------------------------------------------------ | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `SMTP Error: Could not authenticate.` | Read the response text. `Invalid credentials` means the username is not the literal `eusend` or the API key is wrong. A message naming a domain means the From address is on a domain you have not [verified](/docs/domains). Set `$mail->SMTPDebug = SMTP::DEBUG_SERVER;` to print the server's response. | | `SMTP Error: Could not connect to SMTP host.` or `SMTP connect() failed` | The connection is not using implicit TLS on 465, or your host blocks the port. Set `SMTPSecure = PHPMailer::ENCRYPTION_SMTPS` and `Port = 465`. eusend does not accept SMTP on 587 or 25. | | The script hangs, then times out | `SMTPSecure` is `PHPMailer::ENCRYPTION_STARTTLS` or empty while `Port` is 465, so PHPMailer waits for a plaintext greeting. Use `ENCRYPTION_SMTPS`. | | `535 Too many failed attempts` or `421 Connection rejected` | Repeated failed logins block your IP address for up to an hour. Fix the credentials, then wait before retrying. | | `Password` is empty | `getenv('EUSEND_API_KEY')` returned `false` — the variable is not set for the PHP process (web server and CLI often have different environments). | | Send rejected with `550` | Every recipient is on your [suppression list](/docs/emails/suppressions), or the message failed validation. `$mail->ErrorInfo` carries the reason. | See the [SMTP overview](/docs/smtp#troubleshooting) for the full status-code table. # Rails SMTP URL: https://eusend.dev/docs/smtp/rails Configure Action Mailer to deliver through eusend over SMTP — mailers, Devise emails, and any deliver_now/deliver_later, DKIM-signed and tracked. Action Mailer uses SMTP for delivery, so pointing Ruby on Rails at eusend is a one-block configuration change. Every mailer, plus Devise confirmation and password-reset emails, then routes through eusend, DKIM-signed and tracked. ## config/environments/production.rb [#configenvironmentsproductionrb] ```ruby title="config/environments/production.rb" config.action_mailer.delivery_method = :smtp config.action_mailer.smtp_settings = { address: 'smtp.eusend.dev', port: 465, user_name: 'eusend', # the literal string "eusend" password: ENV['EUSEND_API_KEY'], # eu_live_… authentication: :plain, tls: true, # implicit TLS on 465 enable_starttls_auto: false } # Must be an address on a domain verified in eusend config.action_mailer.default_options = { from: 'Acme ' } ``` > [!WARNING] > Use `tls: true` (implicit TLS on port 465), not `enable_starttls_auto`. On some Ruby/`net-smtp` > versions the option is `ssl: true` — both select implicit TLS. ## Send an email [#send-an-email] ```ruby class OrderMailer < ApplicationMailer def shipped(order) mail(to: order.email, subject: 'Your order has shipped') end end OrderMailer.shipped(order).deliver_now # or deliver_later ``` Test the connection from the Rails console: ```ruby ActionMailer::Base.mail( from: 'no-reply@yourdomain.com', to: 'you@example.com', subject: 'SMTP test', body: 'Hello from eusend.' ).deliver_now ``` ## Connection reference [#connection-reference] | Setting | Value | | ----------- | ------------------------------------------------ | | `address` | `smtp.eusend.dev` | | `port` | `465` | | `tls` | `true` | | `user_name` | `eusend` | | `password` | your eusend API key (`eu_live_…`) | | `from` | an address on a [verified domain](/docs/domains) | Use an `eu_test_` key in development — sends are tracked but not delivered. See the [SMTP overview](/docs/smtp) for limits and status codes. ## Troubleshooting [#troubleshooting] | Symptom | Cause and fix | | ------------------------------------------------------------------ | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `Net::SMTPAuthenticationError (535 …)` | Read the response text. `Invalid credentials` means the username is not the literal `eusend` or the API key is wrong. A message naming a domain means the From address is on a domain you have not [verified](/docs/domains). | | `Net::ReadTimeout` or `EOFError: end of file reached` when sending | The connection is not using implicit TLS. Set `tls: true` (or `ssl: true` on older `net-smtp`) with `port: 465`, and keep `enable_starttls_auto: false`. | | `Net::OpenTimeout` | Your host blocks outbound port 465, or the port is set to 587 or 25. eusend only accepts SMTP on 465. Ask your host to open it, or send through the [HTTP API](/docs/emails/send). | | `535 Too many failed attempts` or `421 Connection rejected` | Repeated failed logins block your IP address for up to an hour. Fix the credentials, then wait before retrying. | | Nothing arrives and no error is raised | Check `config.action_mailer.perform_deliveries` is not `false` and set `config.action_mailer.raise_delivery_errors = true` so failures surface. Mail sent with `deliver_later` only goes out while a queue worker is running. | | Works in production, not in development | `smtp_settings` above lives in `production.rb`. Copy it to `development.rb`, with an `eu_test_` key, to send from your machine. | See the [SMTP overview](/docs/smtp#troubleshooting) for the full status-code table. # Supabase custom SMTP URL: https://eusend.dev/docs/smtp/supabase Set up custom SMTP in Supabase to send Auth emails — confirmations, magic links, password resets — through eusend, and fix the errors that come up on the way. Supabase's built-in email service is meant only for testing: it sends 2 messages an hour, and only to addresses on your project's team. In production you must bring your own SMTP provider for auth emails (confirmations, magic links, password resets, invites). Pointing Supabase at eusend gives you DKIM-signed delivery on your own domain, with every auth email visible in your eusend dashboard. ## Connect in one click [#connect-in-one-click] If you would rather not copy anything by hand, connect Supabase from **Settings → Integrations** in the eusend dashboard. You authorize eusend against your Supabase organization, pick the project and a verified sending domain, and we write the SMTP settings into that project's auth config for you — along with a raised auth-email rate limit. The key we create for the connection can only send from the domain you chose, and disconnecting revokes exactly that key and clears the SMTP block again. The manual setup below stays supported, and is the right choice if you would rather not grant write access to your project's auth configuration. ## Connection values [#connection-values] | Parameter | Type | Description | | --- | --- | --- | | `Host` (required) | `smtp.eusend.dev` | The submission server. | | `Port` (required) | `465` | Implicit TLS. STARTTLS (587) is not supported. | | `Username` (required) | `eusend` | The literal string "eusend". | | `Password` (required) | `eu_live_…` | Any eusend API key. | | `Sender email` (required) | `no-reply@yourdomain.com` | Must be a verified domain. | ## Setup [#setup] ### Open SMTP settings [#open-smtp-settings] In the Supabase dashboard go to **Authentication → Emails → SMTP Settings** and toggle on **Enable Custom SMTP**. ### Enter the connection [#enter-the-connection] ```text title="Supabase → Custom SMTP" Host: smtp.eusend.dev Port: 465 Username: eusend Password: Sender email: no-reply@yourdomain.com (must be a verified domain) Sender name: Your App ``` Save. ### Send a test email [#send-a-test-email] Use Supabase's **Send test email** button — it exercises the whole path end to end. A delivered test confirms your key and sender domain are correct. > [!NOTE] > The **sender email** must be an address on a domain you have [verified in eusend](/docs/domains). > An unverified sender domain and a wrong username or key both come back as a `535` — the response > text says which. ## Adjust the rate limit [#adjust-the-rate-limit] Supabase caps auth email throughput separately from your SMTP provider, and starts a project with custom SMTP at 30 emails an hour. Under **Authentication → Rate Limits**, raise **"Rate limit for sending emails"** to match your expected sign-up volume — otherwise Supabase, not eusend, becomes the bottleneck. eusend's own [sending limits](/docs/reference/rate-limits) still apply on top. ## Customizing the email templates [#customizing-the-email-templates] Auth emails are generated and sent by Supabase itself; eusend is only the transport. Customize the templates under **Authentication → Emails → Templates** in Supabase. Everything eusend adds — DKIM, tracking, suppression — is applied to whatever Supabase hands off. ## Troubleshooting [#troubleshooting] | Symptom | Cause and fix | | ------------------------------------------------------------------------------------------------------ | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `Error sending confirmation email`, `Error sending magic link email` or `Error sending recovery email` | Supabase could not hand the message to SMTP. Open **Logs → Auth** in Supabase for the SMTP response: a `535` is credentials or an unverified sender domain (see below), a timeout is a wrong host or port. | | `535` in the Auth log | Read the response text. `Invalid credentials` means the username is not the literal `eusend` or the API key is wrong. A message naming a domain means the From address is on a domain you have not [verified](/docs/domains). In Supabase the key goes in **Password** and the address in **Sender email**. | | `Email address not authorized` | Supabase is still using its built-in service, which only sends to your team's addresses. **Enable Custom SMTP** is off or the settings were not saved. | | `email rate limit exceeded` | Supabase's own limit, not eusend's — 30 an hour until you raise it under **Authentication → Rate Limits**. | | Test email never arrives | Port is 587 or 25. eusend only accepts implicit TLS on 465. With an `eu_test_` key the send is accepted and shown in your eusend dashboard but never delivered. | | `535 Too many failed attempts` or `421 Connection rejected` | Repeated failed logins block your IP address for up to an hour. Fix the credentials, then wait before retrying. | See the [SMTP overview](/docs/smtp#troubleshooting) for the full status-code table. # WordPress SMTP URL: https://eusend.dev/docs/smtp/wordpress Send reliable WordPress email — password resets, WooCommerce receipts, form notifications — through eusend's SMTP relay using WP Mail SMTP or FluentSMTP. By default WordPress sends mail with PHP's `mail()` function, which is unauthenticated and lands in spam or silently disappears. Pointing WordPress at eusend's SMTP relay fixes deliverability for password resets, WooCommerce order receipts, contact-form notifications, and every other email your site sends — all DKIM-signed and tracked in your eusend dashboard. This guide uses the free **WP Mail SMTP** plugin. **FluentSMTP** and **Post SMTP** work identically — the connection values below are the same for any of them. > [!NOTE] > There is also an [official eusend plugin](/docs/integrations/wordpress). It sends over the API > instead of SMTP — so it works on hosts that block outbound port 465 — and records each message's > real delivery status inside WordPress. Run one or the other, never both. ## Connection values [#connection-values] | Parameter | Type | Description | | --- | --- | --- | | `SMTP Host` (required) | `smtp.eusend.dev` | The submission server. | | `Encryption` (required) | `SSL` | Implicit TLS. Not TLS/STARTTLS. | | `SMTP Port` (required) | `465` | Implicit TLS. STARTTLS (587) is not supported. | | `Authentication` (required) | `On` | Enable "Auto TLS" and authentication. | | `SMTP Username` (required) | `eusend` | The literal string "eusend". | | `SMTP Password` (required) | `eu_live_…` | Any eusend API key. | ## Setup [#setup] ### Install WP Mail SMTP [#install-wp-mail-smtp] In WordPress admin go to **Plugins → Add New**, search for **WP Mail SMTP by WPForms**, install it, and activate. A **WP Mail SMTP** item appears in the sidebar. ### Choose the "Other SMTP" mailer [#choose-the-other-smtp-mailer] Open **WP Mail SMTP → Settings**. Under **Mailer**, pick **Other SMTP**. ### Set the From address [#set-the-from-address] Set **From Email** to an address on a domain you have [verified in eusend](/docs/domains) — for example `no-reply@yourdomain.com`. Set **From Name** to your site name, and tick **Force From Email** so plugins can't override it with an unverified address. ### Enter the SMTP connection [#enter-the-smtp-connection] Fill in the connection fields: ```text title="WP Mail SMTP → Other SMTP" SMTP Host: smtp.eusend.dev Encryption: SSL SMTP Port: 465 Authentication: On SMTP Username: eusend SMTP Password: ``` Save. ### Send a test email [#send-a-test-email] Open the **Email Test** tab, enter your own address, and send. A delivered test confirms the whole path. The message also shows up in your eusend dashboard. > [!WARNING] > Set **From Email** to a verified domain and enable **Force From Email**. If WooCommerce or a form > plugin sends from an unverified domain, eusend rejects it with a `535` whose text names the > domain. ## WooCommerce [#woocommerce] No extra configuration is needed. Once WP Mail SMTP routes mail through eusend, WooCommerce order confirmations, invoices, and shipping notifications go through the same relay automatically — just make sure the WooCommerce **"From" address** (WooCommerce → Settings → Emails) is also on your verified domain. ## Troubleshooting [#troubleshooting] | Symptom | Cause | | ------------------------------------------ | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `SMTP Error: Could not authenticate` (535) | Username isn't the literal `eusend`, the API key is wrong, or the From address is on an unverified domain — the response text says which. The key goes in the **password** field. | | Mail rejected with `550` | Every recipient is on your suppression list. | | Test times out on port 465 | Your host blocks outbound 465. There is no alternate port — ask your host to open it, or send through the [HTTP API](/docs/emails/send) instead. | See the [SMTP overview](/docs/smtp) for limits and the full status-code table. # Teams & Workspaces URL: https://eusend.dev/docs/teams Invite people into a workspace, choose what they can do, and run more than one workspace from the same account. A **workspace** is the thing everything else in eusend belongs to: your domains, API keys, contacts, suppression list, templates, sending reputation, usage and invoice. A **team** is the people who can reach one. You get a workspace when you sign up, and you can invite anyone into it from [Settings → Team](/settings/team). ## Roles [#roles] Every member holds one of three roles. They nest — an admin can do everything a member can, an owner everything an admin can. | Capability | Member | Admin | Owner | | ----------------------------------------------- | ------ | ----- | ----- | | Send email, and read the full send log | ✅ | ✅ | ✅ | | Add and verify domains | ✅ | ✅ | ✅ | | Create and revoke API keys | ✅ | ✅ | ✅ | | Register webhook endpoints | ✅ | ✅ | ✅ | | Templates, audiences, contacts and broadcasts | ✅ | ✅ | ✅ | | Invite people, and see pending invites | — | ✅ | ✅ | | Remove members, and see the team activity feed | — | ✅ | ✅ | | Rename the workspace, set branding and tracking | — | ✅ | ✅ | | Connect integrations | — | ✅ | ✅ | | Manage billing and the plan | — | ✅ | ✅ | | Grant or remove the admin role | — | — | ✅ | | Transfer ownership | — | — | ✅ | > [!WARNING] > A **member** is not a read-only role. Everyone on the team can send mail, add domains and mint API > keys — the role boundary is about administering the team and the account, not about protecting the > product surface. Invite people you would trust with an API key, because that is what every role > can create. There is exactly one owner at a time. To hand a workspace over, the current owner uses **Transfer ownership** in Settings → Team; they become an admin, and the person they name becomes the owner. Transferring needs a sign-in from the last 10 minutes; if yours is older you are asked to sign in again first. Both the outgoing and the new owner get an email about the transfer. ## Inviting people [#inviting-people] Admins and owners invite by email address. The invitation is a one-time link that expires after **7 days**, and it works whether or not the recipient already has an eusend account — signing up through it drops them straight into your workspace. You can have up to **25 pending invitations** at a time, and send up to 20 an hour. Cancel one that has not been accepted from the same page. The owner gets an email whenever someone accepts an invitation and joins, naming who sent it, so a member you don't recognise doesn't go unnoticed. Someone who joins through an invitation does **not** get a personal workspace of their own along the way. If they are later removed from every workspace they belong to, they are shown a recovery page that creates one for them. ## Two-factor authentication [#two-factor-authentication] The team list shows a **2FA** badge against each member, so you can see at a glance who has a second factor on their account and who signs in with a password alone. It is visible to everyone on the team, not just to admins. Anyone with an account can create API keys and reach your domains and contacts, so an account without a second factor is a risk the whole team carries — which is the reason this is shown to the whole team. Nobody can change anyone else's setting; each person turns theirs on under **Account settings → Two-factor authentication**. eusend does not currently let you *require* 2FA for a workspace. If you need that, email [support@eusend.dev](mailto:support@eusend.dev) — it helps to know who is asking. ## Multiple workspaces [#multiple-workspaces] One account can own several workspaces, and the switcher at the top of the sidebar moves between them without signing out. Use them to keep one client apart from another, or production apart from staging. Workspaces share nothing but you: * separate domains, API keys and webhook endpoints * separate contacts, audiences and suppression lists * separate usage, quota and daily sending limits * separate sending reputation — a bounce problem in one never touches another * separate invoices, and a separate team Create one from **New workspace** in the workspace switcher. ### Billing [#billing] Your first workspace is free, on the same 3,000 emails a month as any other free account. **Additional workspaces choose a plan when you create them** and are billed separately — each has its own subscription, its own volume and its own invoice, so you can size them independently and cancel one without touching the others. Being invited into somebody else's workspace does not use up your free one. > [!NOTE] > There is no limit on how many workspaces you can own. ### If a workspace's subscription ends [#if-a-workspaces-subscription-ends] An additional workspace with no live subscription goes **inactive**. Sending stops — the API answers [`WORKSPACE_INACTIVE`](/docs/reference/error-codes) on the send routes, and new domains and API keys cannot be created — but **nothing is deleted**. Your contacts, domains, templates and logs stay exactly as they were, the workspace stays in your switcher marked *Inactive*, and choosing a plan for it in Settings → Billing starts it sending again. The same state applies to a workspace you created but never completed checkout for. One that is still empty a week later is cleaned up automatically; one with anything in it is kept. Your first workspace never goes inactive — it falls back to the free plan. ## Deleting a workspace [#deleting-a-workspace] There is no self-serve delete. Email [support@eusend.dev](mailto:support@eusend.dev) from the owner's address and we will remove it, or use **Account settings → Delete account** to delete your account and everything in it. # Email Templates URL: https://eusend.dev/docs/templates Create reusable email templates by submitting rendered HTML, personalized at send time via {{variable}} placeholders. Create reusable email templates by submitting rendered HTML — write them by hand or render a React Email component locally with `@react-email/render` and submit the result. Templates are stored server-side and personalized at send time via `{{variable}}` placeholders. ## Creating templates [#creating-templates] Templates can be created in the **Templates** section of the dashboard, which provides a live-preview editor. They can also be created via the API. ## API endpoints [#api-endpoints] `POST /templates` | Parameter | Type | Description | | --- | --- | --- | | `name` (required) | `string` | Display name for the template. | | `subject` (required) | `string` | Default email subject. Supports {{variable}} placeholders. Can be overridden per send. | | `html` (required) | `string` | HTML content. Supports {{variable}} placeholders. Variable values are HTML-escaped at render time, so put HTML structure in the template itself — not in variable values. | > [!NOTE] > A template holds a subject and an HTML body only — there is no stored plain-text part. One is > generated from the rendered HTML at send time; pass `text` on the send itself to write your own. ```bash title="create template" curl -X POST https://api.eusend.dev/templates \ -H "Authorization: Bearer eu_live_xxxxxxxxxxxx" \ -H "Content-Type: application/json" \ -d '{ "name": "Order Confirmation", "subject": "Your order #{{order_id}} is confirmed", "html": "

Hi {{first_name}}!

Order #{{order_id}} confirmed.

" }' ``` ```json title="response — 201 Created" { "id": "550e8400-e29b-41d4-a716-446655440000", "name": "Order Confirmation", "createdAt": "2026-05-20T10:00:00.000Z" } ``` The rest of the template CRUD surface: `GET /templates` List all templates. `GET /templates/:id` Get a template. `PATCH /templates/:id` Update a template. `DELETE /templates/:id` Delete a template. # Open & Click Tracking URL: https://eusend.dev/docs/tracking Track email opens and link clicks — off by default, switched on per send or for your whole organization. All tracking requests pass through EU infrastructure — no data is sent to US services. eusend can track email opens and link clicks. All tracking requests pass through EU infrastructure — no data is sent to US services. ## Why eusend has tracking at all [#why-eusend-has-tracking-at-all] It is a fair question. A pixel that reports back when you read your mail is exactly the kind of thing an EU-native product is supposed to be sceptical of, and we don't pretend otherwise. Two reasons it exists anyway. The first is that open and click data is how you find out whether your mail is actually landing — a domain whose delivery is quietly rotting usually shows up as engagement falling before it shows up as bounces. The second is that a provider without it doesn't remove tracking from the world; it just keeps people on US providers who serve the same pixel from US infrastructure. Building it here means the request terminates in the EU, and that the data stops at what we describe below. So the design constraint was never *whether* to track but **how little we could get away with recording**. We could have collected far more than we do, and most of the industry does: | | Common elsewhere | eusend | | ------------------------------------- | ---------------- | --------------- | | IP address of the reader | Stored | Never stored | | Country / city / geolocation | Derived from IP | Never derived | | Device, OS and mail client breakdown | Parsed from UA | Not parsed | | Every repeat open, with timestamps | Full timeline | First open only | | Per-recipient engagement scores | Profiles built | Not built | | Reader data shared with third parties | Common | Never | There is no profile of your recipients anywhere in eusend, and nothing survives the retention window on your plan. What is left is a count of opens and clicks per message — enough to answer "is this getting through", not enough to describe a person. Tracking is **off by default**. [One switch turns it on](#turning-tracking-on) for your whole organization, including SMTP and broadcasts, or you can enable it per send. ## Why it is off by default [#why-it-is-off-by-default] Tracking costs deliverability. Click tracking rewrites every link in your message to point at eusend's tracking host instead of your own domain, and mailbox providers weigh a link domain that doesn't match the sender as a spam signal — on a sign-in link or a password reset, that is the last place you want one. The open pixel is a remote image that many filters and privacy-protecting clients treat with suspicion too. For transactional mail, the signals that actually tell you whether mail is landing are delivery, bounce and complaint events, and those are always on. Turn tracking on where you need the engagement numbers — typically broadcasts — and leave your transactional mail clean. > [!NOTE] > Organizations created before 16 October 2026 kept the setting they had, which for most is **on**. > Check **Settings → General → Email tracking** if you want to switch. ## How a setting is resolved [#how-a-setting-is-resolved] Three levels, most specific first: 1. **The `track_opens` / `track_clicks` flag on the send**, when you pass one. 2. **Your organization default**, in the dashboard under **Settings → General → Email tracking**. 3. **Off**, which is what the organization default ships as. Omitting a flag is not the same as passing `false`. Omitting it defers to your organization default; `false` turns tracking off for that send whatever the default says. The organization default is the only level that reaches every send path — [SMTP](/docs/smtp) messages have nowhere to carry a per-send flag, so for SMTP that setting *is* the control. Broadcasts resolve it once, when the broadcast is created, and keep that answer. ## Open tracking [#open-tracking] eusend injects a 1×1 transparent pixel into the HTML body, and when the recipient's email client loads the image, eusend records an `opened` event. > [!WARNING] > Open tracking is inherently imprecise. Email clients that pre-fetch images (like Apple Mail with > Mail Privacy Protection) may record false opens. Many clients also block remote images by default. ## Click tracking [#click-tracking] All `href` links in the HTML body are rewritten to pass through eusend's tracking endpoint; when clicked, a `clicked` event is recorded and the recipient is immediately redirected to the original URL. With click tracking off, your original URLs are delivered untouched. ## What we record [#what-we-record] An open stores the requesting **user agent**, and only for the **first** open — repeat opens of the same message are discarded, so there is no read timeline. A click stores the **destination URL** and the id of the link. Neither stores the recipient's IP address, and we derive no location from it. Events are deleted with the email log they belong to — 30 days on Free and the volumes up to 100,000, 90 days from 250,000 up. See [plans](/docs/reference/plans). ## Turning tracking on [#turning-tracking-on] For a single send, pass either flag as `true`: ```json { "from": "hello@acme.com", "to": "user@example.com", "subject": "...", "html": "...", "track_opens": true, "track_clicks": true } ``` For every send from your organization — API, SMTP and broadcasts alike — turn the defaults on under **Settings → General → Email tracking**. A send that passes an explicit flag still overrides it, so with the defaults on you can still pass `false` on mail like sign-in links and password resets. For one broadcast, use the **Tracking** checkboxes in the composer, or pass the flags when creating it through the API: ```json { "name": "March newsletter", "audience_id": "aud_...", "from": "hello@acme.com", "subject": "...", "html": "...", "track_opens": true, "track_clicks": true } ``` Tracking has no effect on unsubscribe links, which broadcasts always carry. ## Consent [#consent] You are the controller for the people you email, so whether you have a lawful basis to track them is your decision, not ours. In much of the EU a tracking pixel needs consent under the ePrivacy Directive (Article 5(3)), separately from whatever basis you rely on to send the message at all — a distinction that catches people out most often on marketing broadcasts. The settings above exist so that decision can live in one place rather than on every call. ## Analytics dashboard [#analytics-dashboard] Aggregate open and click stats are visualised in the **Analytics** section of the dashboard, with charts broken down by time period, status, and domain. # Webhooks URL: https://eusend.dev/docs/webhooks Subscribe to email events and receive real-time HTTP POST notifications at your endpoint. Subscribe to email events and receive real-time HTTP POST notifications at your endpoint. A failed delivery is retried with exponential back-off for about four hours (10 attempts in total) before it is marked failed. When a delivery fails for good, we email the account owner — at most once per endpoint per day. If every delivery to an endpoint has failed for three days straight, the endpoint is disabled: new events are no longer queued for it, and the owner is emailed again. Fix the endpoint, send a test event, then enable it again with `PATCH /webhooks/:id` and `{ "enabled": true }` or from the dashboard. How many endpoints you may register depends on your plan — one on the free tier, more on Production. Creating one past the cap returns `403` with code `PLAN_LIMIT_EXCEEDED`; see [pricing](/pricing) for the number on each plan. Endpoints you already have keep working if your plan changes. `POST /webhooks` | Parameter | Type | Description | | --- | --- | --- | | `url` (required) | `string` | Public HTTP(S) endpoint to receive events. Private, loopback, and internal addresses are rejected — both at creation and again (after DNS resolution) before each delivery. | | `events` (required) | `string[]` | Event types to subscribe to. Use "*" to subscribe to all events. | ```bash title="create webhook" curl -X POST https://api.eusend.dev/webhooks \ -H "Authorization: Bearer eu_live_xxxxxxxxxxxx" \ -H "Content-Type: application/json" \ -d '{ "url": "https://yourapp.com/webhooks/eusend", "events": ["email.delivered", "email.bounced", "email.complained"] }' ``` ```json title="response — 201 Created" { "id": "a1b2c3d4-e5f6-4a7b-8c9d-0e1f2a3b4c5d", "url": "https://yourapp.com/webhooks/eusend", "events": ["email.delivered", "email.bounced", "email.complained"], "secret": "AbCdEfGhIjKlMnOpQrStUvWxYz0123456789ABC", "disabledAt": null, "disabledReason": null, "createdAt": "2026-05-20T10:00:00.000Z" } ``` > [!NOTE] > Store the `secret` securely — you'll need it to verify incoming webhook signatures. If you lose > it, retrieve it again with `GET /webhooks/:id/secret`, or view it on the webhook's page in the > dashboard. > [!NOTE] > Your endpoint must respond directly with a `2xx` status. Redirects (`3xx`) are not followed and > count as a failed delivery. The rest of the webhooks surface: Creating, updating, and deleting endpoints requires a live API key or the dashboard. Test-mode keys can read endpoints and deliveries, and test sends still trigger configured webhooks, but cannot change endpoints or access their signing secrets. `GET /webhooks` List webhooks. `GET /webhooks/:id` Get webhook + recent deliveries. `PATCH /webhooks/:id` Update `url`, `events`, or `enabled`. Setting `enabled` to `false` pauses the endpoint (`disabledReason: "manual"`); `true` re-enables an endpoint that was paused or disabled for failing (`disabledReason: "failing"`). Events that happen while an endpoint is disabled are not queued and are not replayed when it is enabled again. `POST /webhooks/:id/test` Send one `webhook.test` event to the endpoint, signed like any other, and return `202` with the delivery `id`. It is attempted once, so its result shows up in the delivery log within seconds. Works on a disabled endpoint, so you can confirm a fix before enabling it again. ```json title="webhook.test payload" { "type": "webhook.test", "webhook_id": "a1b2c3d4-e5f6-4a7b-8c9d-0e1f2a3b4c5d", "timestamp": "2026-05-20T10:00:00.000Z" } ``` `GET /webhooks/:id/secret` Retrieve the signing secret. `POST /webhooks/:id/rotate-secret` Replace the signing secret and return the new one. It takes effect immediately — the previous secret stops verifying on the next delivery, so update your endpoint first unless you are rotating because the old secret leaked. `DELETE /webhooks/:id` Delete webhook. # Events URL: https://eusend.dev/docs/webhooks/events Subscribe to any combination of these event types, or use * to receive all of them. Subscribe to any combination of these event types, or use `*` to receive all of them. | Event | Description | | ------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | | `email.sent` | Email was accepted and is in transit. | | `email.delivered` | Delivery confirmed by the receiving mail server. | | `email.bounced` | Email hard-bounced (permanent failure) and the address was suppressed. The payload includes `bounce_type` plus the receiving server's verbatim reason — see [Reading a bounce](#reading-a-bounce). Transient/soft failures are retried and do not fire this event. | | `email.complained` | Recipient marked the email as spam. | | `email.opened` | Recipient opened the email (requires `track_opens`). Fires once per email. | | `email.clicked` | Recipient clicked a tracked link (requires `track_clicks`). Payload includes `link_id` and `url`. Repeat clicks on the same link within a minute count once, up to 20 clicks per email per hour. | | `email.failed` | The email will not be delivered and was not rejected by a recipient server: the account could not send when it was picked up, delivery was abandoned after retries, or it never reached the queue. Payload includes `reason`. | | `email.suppressed` | Recipients on your suppression list were dropped and not sent to. Fires for an email whose recipients were all suppressed, and for the record of recipients removed from a partly suppressed send. Payload includes `recipients`. | | `*` | Wildcard — subscribes to all current and future event types. | ## Payload structure [#payload-structure] ```json title="example payload (email.delivered)" { "type": "email.delivered", "email_id": "9a8b7c6d-5e4f-4a3b-8c1d-0e9f8a7b6c5d", "recipients": ["alice@example.com"], "tags": { "category": "shipping_update" }, "timestamp": "2026-05-20T10:00:03.000Z" } ``` > [!NOTE] > `timestamp` is when the event itself happened — the moment our MTA recorded the delivery, or > the arrival date on an async bounce/complaint report — not when we sent you the webhook. For > delivery time, read the `webhook-timestamp` header; the two differ when a retry or a backlog > delays the notification. > > Every payload includes `type`, `email_id`, `tags`, and `timestamp`. Some events add fields: > `provider_message_id` (sent), `recipients` (delivered, bounced, complained, suppressed), `bounce_type` + > `diagnostic` (bounced), `link_id` + `url` (clicked), and `reason` (failed). Deliveries from a test-mode send also > carry `test_mode: true`. ## Reading a bounce [#reading-a-bounce] `bounce_type` is our own classifier's bucket, and it is frequently `Uncategorized` — a real rejection we have no specific rule for. It is not enough on its own to tell an invalid mailbox from a reputation block, so a bounce payload also carries the receiving server's own words: ```json title="example payload (email.bounced)" { "type": "email.bounced", "email_id": "9a8b7c6d-5e4f-4a3b-8c1d-0e9f8a7b6c5d", "bounce_type": "Uncategorized", "smtp_code": 554, "diagnostic": "Your access to this mail system has been rejected due to poor reputation of a domain used in message transfer", "recipients": ["alice@example.com"], "counts_toward_reputation": false, "tags": {}, "timestamp": "2026-05-20T10:00:03.000Z" } ``` | Field | Notes | | -------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `smtp_code` | Numeric SMTP reply code (`550`, `554`, …). Absent when the bounce arrived asynchronously as a DSN rather than on the SMTP session. | | `diagnostic` | The remote server's reason, trimmed to 500 characters, with our sending IPs shown as `[sending IP]`. Absent when the remote sent no text. | | `dsn_status` | Dotted status (`5.1.1`) — present only on asynchronous DSN bounces, in place of `smtp_code`. | | `counts_toward_reputation` | `true` when the bounce counts toward your [bounce rate](/docs/reference/rate-limits). `false` when the rejection was about our sending infrastructure rather than the address — a blocked IP, an authentication failure, a temporary condition — so there is nothing to clean from your list. | > [!WARNING] > Treat both as opaque text for humans and logs. Wording varies by provider and changes without > notice, so match on `bounce_type` or `smtp_code` when you need to branch in code — never on > `diagnostic`. `tags` carries whatever [tags](/docs/emails/tags) the send was created with, as an object — `{}` when it had none, never absent — so you can route on `payload.tags.category` without checking the field exists first. # Security URL: https://eusend.dev/docs/webhooks/security Every webhook delivery includes an HMAC-SHA256 signature so you can verify it originated from eusend. Every webhook delivery includes a signature so you can verify it originated from eusend. ## Headers [#headers] | Parameter | Type | Description | | --- | --- | --- | | `webhook-id` | `string` | Unique delivery ID for this event. | | `webhook-timestamp` | `string` | Unix timestamp (seconds) of delivery time. | | `webhook-signature` | `string` | HMAC-SHA256 signature prefixed with v1,. | ## Verification [#verification] The signature is computed as `HMAC-SHA256(secret, "{webhook-id}.{webhook-timestamp}.{body}")`, then base64-encoded and prefixed with `v1,`. The `webhook-id` and `webhook-timestamp` values are the ones sent in the request headers (each delivery has a unique `webhook-id`). ```js title="node.js verification" import { createHmac, timingSafeEqual } from 'crypto' function verifyWebhook(req, secret) { const id = req.headers['webhook-id'] const timestamp = req.headers['webhook-timestamp'] const signature = req.headers['webhook-signature'] const body = req.rawBody // must be the raw string, not parsed JSON const signed = `${id}.${timestamp}.${body}` const expected = 'v1,' + createHmac('sha256', secret).update(signed).digest('base64') const received = Buffer.from(signature ?? '', 'utf8') const digest = Buffer.from(expected, 'utf8') // timingSafeEqual throws on a length mismatch, so check that first — a missing // or truncated header is exactly the case that would otherwise crash the handler. if (received.length !== digest.length || !timingSafeEqual(received, digest)) { throw new Error('Invalid webhook signature') } return JSON.parse(body) } ``` > [!TIP] > Always compare signatures with a constant-time comparison — a plain `===` leaks how much of the > signature matched. In Node.js that's `crypto.timingSafeEqual()`, guarded by the length check > above.