Skip to content

Commit e0cca8c

Browse files
committed
Docs: update Mandrill webhook instructions
* Mandrill now refers to "whitelist change" events (used to be "whitelist sync"). * More details on solving validation failures due to webhook url mismatches.
1 parent 9665114 commit e0cca8c

File tree

1 file changed

+12
-4
lines changed

1 file changed

+12
-4
lines changed

docs/esps/mandrill.rst

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -206,21 +206,29 @@ setting up Anymail's webhook URL requires deploying your Django project twice:
206206
* *yoursite.example.com* is your Django site
207207

208208
Be sure to check the boxes in the Mandrill settings for the event types you want to receive.
209-
The same Anymail tracking URL can handle all Mandrill "message" and "sync" events.
209+
The same Anymail tracking URL can handle all Mandrill "message" and "change" events.
210210

211211
2. Mandrill will provide you a "webhook authentication key" once it verifies the URL
212212
is working. Add this to your Django project's Anymail settings under
213213
:setting:`MANDRILL_WEBHOOK_KEY <ANYMAIL_MANDRILL_WEBHOOK_KEY>`.
214214
(You may also need to set :setting:`MANDRILL_WEBHOOK_URL <ANYMAIL_MANDRILL_WEBHOOK_URL>`
215215
depending on your server config.) Then deploy your project again.
216216

217-
Mandrill implements webhook signing on the entire event payload, and Anymail will
218-
verify the signature. Until the correct webhook key is set, Anymail will raise
217+
Mandrill implements webhook signing on the entire event payload, and Anymail verifies this
218+
signature. Until the correct webhook key is set, Anymail will raise
219219
an exception for any webhook calls from Mandrill (other than the initial validation request).
220220

221+
Mandrill's webhook signature also covers the exact posting URL. Anymail can usually
222+
figure out the correct (public) URL where Mandrill called your webhook. But if you're
223+
getting an :exc:`AnymailWebhookValidationFailure` with a different URL than you
224+
provided Mandrill, you may need to examine your Django :setting:`SECURE_PROXY_SSL_HEADER`,
225+
:setting:`USE_X_FORWARDED_HOST`, and/or :setting:`USE_X_FORWARDED_PORT` settings. If all
226+
else fails, you can set Anymail's :setting:`MANDRILL_WEBHOOK_URL <ANYMAIL_MANDRILL_WEBHOOK_URL>`
227+
to the same public webhook URL you gave Mandrill.
228+
221229
Mandrill will report these Anymail :attr:`~anymail.signals.AnymailTrackingEvent.event_type`\s:
222230
sent, rejected, deferred, bounced, opened, clicked, complained, unsubscribed. Mandrill does
223-
not support delivered events. Mandrill "whitelist" and "blacklist" sync events will show up
231+
not support delivered events. Mandrill "whitelist" and "blacklist" change events will show up
224232
as Anymail's unknown event_type.
225233

226234
The event's :attr:`~anymail.signals.AnymailTrackingEvent.esp_event` field will be

0 commit comments

Comments
 (0)