White-labeling involves two main components:

  1. Using your customer’s email service provider
  2. Sending from your customer’s email domain

Courier enables this by allowing you to override the API key of your email provider integration with your customer’s provider API key.

Set Up Email Service Provider Integrations

  1. Add an integration in your Courier Workspace for each email provider you’d like to support.
  2. Add those integrations to the email channel of the notification template you want to white-label.

NOTE

The initial API keys for these integrations don’t need to be valid if you’re always overriding them via the Send API.

Configure Provider Selection

Use provider-level conditions to determine which provider gets used. For example:

  • Send a data field named “email-provider” with the value “mailgun”
  • Set a rule that only enables that provider if that value has been set

Override the API Key

When sending an email, provide your customer’s API key using the override section of the send command.

{
  "event": "EVENT_ID",
  "recipient": {
    "id": "RECIPIENT_ID",
    "profile": {
      "email": "RECIPIENT_EMAIL",
      "email-provider": "mailgun"
    }
  },
  "data": {
    "override": {
      "mailgun": {
        "api_key": "CUSTOMER_API_KEY"
      }
    }
  }
}

Set the ‘From’ Email Address

To use your customer’s email address as the sender:

  • Use a variable in the email channel settings
  • Set this variable when sending the email

For more details, see Customizing Email Address Fields.