OneSignal's Email Messaging requires the use of a third-party email service provider to handle email delivery. All you have to do is set up the integration between the provider and OneSignal, and you'll be ready to send emails through OneSignal.
Unfortunately the MailGun EU API will not work at this time. You will need to use the US API or another provider like Mandrill or Sendgrid.
If you do not already have a Mailgun account, create one now.
Next, you will need to set up your domain so that it can send emails from Mailgun. Go to Sending > Domains and click 'Add New Domain'
Then, add your domain and follow the setup. Mailgun provides great documentation on getting setup.
You will be given two TXT (SPF and DKIM), two MX, and a CNAME record. You will need to update your DNS records for your domain host.
Once you have set up your DNS records, it make take up to 48 hours to work. Mailgun will email you when your domain is verified.
Next, in Mailgun go to Sending > Domains and click the domain you are setting up with email:
Save the following data: Domain, Username, and Default password.
In mailgun under Settings > API Keys use the Private API key for the OneSignal API KEY Field.
Make sure you are not blocking the OneSignal Server API keys under "IP Whitelist".
Recommended to keep this section blank. However, if you use it add
220.127.116.11/30 to make sure it is not blocked.
Your Mailgun API key and SMTP credentials are like a password. Keep them safe and do not share them.
In OneSignal, go to Settings > Platforms > Email
Next, you must configure your email settings. Select Mailgun as the provider, and paste in the Domain you set up with Mailgun, Private API key, SMTP Username, and SMTP Password (aka Default Password) you just copied in above steps.
Default SMTP Login
Private API key
Add the name and email address that you want your emails to come from (you may override these when sending a message.
By default, Identity Verification is disabled, however we recommend using it. You can enable Identity Verification here if you can support it.
To simplify setup and be able to access email delivery statistics, OneSignal will automatically configure Webhooks with Mailgun. Unfortunately, Mailgun only supports a single webhook for a given account. OneSignal requires webhooks to use Email Messaging, which may conflict with webhooks previously set up (e.g. for an analytics integration).
If you need the webhook you previously set up, you should contact us for possible workarounds.
If you do not need the webhook you previously set up, you must disable it.
Please see Mailgun's docs on this here: https://help.mailgun.com/hc/en-us/articles/360011566033-How-to-Enable-HTTPS-Tracking-Links
In your MailGun Account under Sending > Logs, search the dates you sent the email. Click the email and check the
description and error
code for more details.
This means Mailgun tried to contact the mail server for that email address, but the MX server did not respond. You may be on a lower tier plan with Mailgun and need to upgrade or have a configuration error for the MX record, check your DNS settings to make sure it is setup correctly.
Updated about 1 year ago