Emails

Send partner and team emails from your own provider and domain, with your branding, in each recipient's language, and customize any template.

Embed
Preview of the card
<a href="https://referalli.com/docs/emails"><img src="https://referalli.com/docs/_api/public/orgs/07f432f4-34b9-46a7-aaad-c0e395d2e4f9/spaces/2bf4f614-3630-4fbf-85f9-5ecafa6b7d97/pages/6c77d7bb-d41d-4ab0-b831-98c4f4f0f728/social-card.svg?v=3e7ae33eec8b" alt="Emails" width="600" height="315"></a>

Referalli emails your partners and your team when something needs their attention: a payout was sent or failed, an invitation or a contract arrived, a partner was approved, a webhook endpoint was disabled, a tax form is ready. Every email comes from your own email provider and domain, carries your branding, and is written in the recipient's language.

Connect your provider

Referalli never sends from a shared account. Bring your own key from Resend, Brevo or Postmark:

curl -X PUT https://referalli.com/v1/email/settings \
  -H "Authorization: Bearer $KEY" -H "content-type: application/json" \
  -d '{
    "provider": "resend",
    "apiKey": "re_...",
    "fromAddress": "partners@yourbrand.com",
    "fromName": "YourBrand Partners",
    "replyTo": "partners-help@yourbrand.com",
    "defaultLocale": "en",
    "logoUrl": "https://yourbrand.com/logo.png",
    "primaryColor": "#0e9f6e"
  }'

Field

Meaning

provider

resend, brevo or postmark; null turns your own provider off.

apiKey

Write-only: it's stored encrypted and never returned (hasApiKey tells you one is set). Omit it to keep the stored key; send null to remove it.

fromAddress

An address on a domain you've verified with your provider.

fromName, replyTo

Optional sender name and reply-to address.

defaultLocale

The language for recipients who haven't picked one: en, es, de, fr, pt, it, nl, sv, ja or zh.

logoUrl, primaryColor

Branding for the email header and button. The colour is #rrggbb.

Owners and admins only. GET /v1/email/settings returns the same fields plus domainStatus.

POST /v1/email/settings/verify-domain asks your provider whether the domain of fromAddress is verified and stores the answer: verified, pending, failed or unknown. Resend and Brevo answer with the sending key; Postmark needs an account token, so it reports unknown (Postmark still refuses unverified senders).

Until you add a key, emails use the operator's provider if one is configured, and otherwise aren't sent. In-app notifications are always created.

Languages

Each email goes out in the recipient's language: the one they picked in the dashboard or partner portal language menu, else your defaultLocale, else English. The menus save the choice with PUT /v1/me/locale and PUT /v1/partner/locale ({ "locale": "de" }). Amounts are formatted for that language, so €123.45 becomes 123,45 € in German.

Templates

Every email has a default template in all 10 languages. GET /v1/email/templates lists each event with its placeholders, and for every language the default and your override, if you have one.

Event

Sent to

Placeholders

payout_sent

partner

{merchant}, {amount}, {url}

payout_failed

your team (owner)

{merchant}, {url}

invitation_received

partner

{merchant}, {program}, {url}

partner_approved

partner

{merchant}, {program}, {url}

contract_sent

partner

{merchant}, {url}

webhook_endpoint_disabled

your team (owner)

{merchant}, {endpoint}, {days}, {url}

tax_document_ready

partner

{merchant}, {year}, {url}

Override one event in one language:

curl -X PUT https://referalli.com/v1/email/templates/payout_sent/de \
  -H "Authorization: Bearer $KEY" -H "content-type: application/json" \
  -d '{
    "subject": "Deine Auszahlung über {amount} ist unterwegs",
    "text": "Hallo! {merchant} hat dir {amount} überwiesen.\n\nDetails: {url}",
    "html": "<p>Hallo! <strong>{merchant}</strong> hat dir {amount} überwiesen.</p><p><a href=\"{url}\">Details ansehen</a></p>"
  }'
  • subject and text are required; html is optional, and without it the HTML is built from the text.

  • Values are HTML-escaped wherever they appear in the HTML, so a program name can't inject markup. Your HTML is kept, except scripts, frames, forms, event handlers and javascript: links, which are removed before sending.

  • Every email is wrapped in your branded layout (logo or name, colour, footer).

  • Other languages keep the default. DELETE /v1/email/templates/payout_sent/de returns that language to the default.

Preview and test

  • POST /v1/email/preview with { "event": "payout_sent", "locale": "de" } renders the stored template with sample values; add "draft": { "subject", "text", "html" } to preview an unsaved edit. The response has subject, text, html, locale and source (override or default).

  • POST /v1/email/test with { "event", "locale", "to": "you@yourbrand.com" } sends that email with sample values through your provider. A provider refusal comes back as 400 with the provider's reason.

The dashboard has all of this under Settings → Emails.

Updated