Mandrill
Looking for a way to send email notifications via Mandrill? This step-by-step tutorial will show you how to integrate Mandrill’s API the easy way.
Profile Requirements
To deliver a message to a recipient over Mandrill, Courier must be provided the recipient’s email address. This value should be included in the recipient profile as email
.
Override
You can use a provider override to replace what we send to Mandrill’s Messages API. For example, you can add an attachment to your request:
Everything inside of messageproviders.mandrill.override
will replace what we send to Mandrill’s Messages API. You can see all the available options by visiting Mandrill API docs.
Template Import
You can import your Mandrill templates to use with Courier from the Mandrill configuration page.
INFO
You will need to provide your Mandrill credentials in the configuration page to retrieve your saved templates from Mandrill.
Templates ready for import will appear as selectable checkboxes that you can choose to import.
Template Import Page
Troubleshooting
Dealing with Mandrill requests can result in some errors. You can find them below to help you troubleshoot. You can also check the Courier Logs to help debug any provier errors you may encounter. For anything else, you may contact Courier Support.
Mandrill Click Tracking Not Working
The three most possible causes are that you have not enabled click tracking, the URL is too long, so Mandrill has disabled click-tracking, or the clicks are recorded but not updated in real-time.
Solution
- Verify whether click tracking is enabled.
- Login to the Mandrill account.
- Settings -> Sending defaults.
- Make sure your choice from the “Track Clicks” dropdown is something other than the “No click tracking” option.
Even though the opens and clicks get tracked in real-time, the status updates may delay from a few minutes to a more extended period. For instance, this may happen due to the load on their system. Courier provides its own link tracking which you can use to track clicks on your notification templates.
Mandrill BCC Not Working
Most possibly, Mandrill is ignoring the BCC headers and hence this error occurs.
Solution
- Try using the
to
field rather than thebcc
field and setX-MC-PreserveRecipients
tofalse
. - Or, specify the
bcc
address in theto
field but declare theirtype
asbcc
. Addpreserve_recipients: true
under the message section. The code given below is an example of implementing this solution.
You can read more about X-MC-PreserveRecipients here
Mandrill CC Emails Not Present
CC email fields passed to Mandrill’s API can be done through the designer, or through an API override definition.
Similar to BCC emails not being respected, preserve_recipients
needs to be set to true
in the override schema request so that CC emails can be passed to Mandrill’s API. If this field isn’t set to true
, CC emails will not be sent.
Solution
Mandrill Merge Vars Not Working
The cause for the Mandrill merge variables not working is possible because of an issue with the nesting.
Solution
You have to make sure the variables are nested in the message
struct for it to work. Given below is an example of how it is done.