Skip to content

Mailgun

The service sends its own emails through Mailgun: email confirmation, password resets, welcome messages, payment failures, and the signing emails that don’t come from the sender’s mailbox (see Signing emails).

  1. Add a sending domain in Mailgun. A subdomain such as mg.example.com keeps this mail separate from your main domain’s reputation. The domain lives in Mailgun’s US or EU region; set MAILGUN_REGION to match.

  2. Verify the domain. Add the DNS records Mailgun shows (SPF and DKIM TXT records, and the MX and tracking records if you want them) at your DNS provider, then verify in Mailgun. Sending fails until the domain is verified.

  3. Create an API key with sending access.

  4. Configure the API:

    Terminal window
    MAILGUN_API_KEY=...
    MAILGUN_DOMAIN=mg.example.com
    MAILGUN_REGION=us # or eu
    EMAIL_FROM="Your Product <no-reply@mg.example.com>"

    With an API key set, EMAIL_TRANSPORT defaults to mailgun.

  • Emails from the service use EMAIL_FROM as is.
  • Emails sent on someone’s behalf (signing invitations and reminders when Microsoft 365 isn’t used, and welcome messages) keep the address of EMAIL_FROM but change the display name to Their Name via Your Product, and set Reply-To to that person’s email.
  • Completed-signature emails attach the signed PDF when it’s 10 MB or smaller.