Right now there's no way to alter Mandrill messages to include/edit things like Mandrill metadata or tags.
This was also requested in #1661350: Allow more customization of message from drupal_mail but not added (instead that issue added support for file attachments).
| Comment | File | Size | Author |
|---|---|---|---|
| #1 | 1748234-1-mandrill_mail_alter.patch | 442 bytes | fenstrat |
Comments
Comment #1
fenstratAttached adds a simple drupal_alter() right before the message is sent.
Comment #2
pal4life commentedWhat is this patch about? Pardon my naivety.
Comment #3
fenstrat@pal4life No worries, this allows modules to implement hook_mandrill_mail_alter() and alter any message parameters in $mandrill_message before sending.
That's a very simple example which inserts 'my_tracking_id' into metadata in the Mandrill message. You can then use this with Mandrill webhooks to process/track updates and use 'my_tracking_id' to uniquely identify which message the updates relate to.
Comment #4
levelos commentedThanks @fenstrat, committed.
Comment #5
fenstratGreat, thanks @levelos.