@@ -191,20 +191,32 @@ Status tracking webhooks
191191------------------------
192192
193193If you are using Anymail's normalized :ref: `status tracking <event-tracking >`,
194- follow ` Mandrill's instructions `_ to add Anymail's webhook URL:
194+ setting up Anymail's webhook URL requires deploying your Django project twice :
195195
196- :samp: `https://{ random } :{ random } @{ yoursite.example.com } /anymail/mandrill/tracking/ `
196+ 1. First, follow the instructions to
197+ :ref: `configure Anymail's webhooks <webhooks-configuration >`. You *must *
198+ deploy before adding the webhook URL to Mandrill, because it will attempt
199+ to verify the URL against your production server.
197200
198- * *random:random * is an :setting: `ANYMAIL_WEBHOOK_AUTHORIZATION ` shared secret
199- * *yoursite.example.com * is your Django site
201+ Follow `Mandrill's instructions `_ to add Anymail's webhook URL in their settings:
200202
201- Be sure to check the boxes in the Mandrill settings for the event types you want to receive.
202- The same Anymail tracking URL can handle all Mandrill "message" and "sync" events.
203+ :samp: `https://{ random } :{ random } @{ yoursite.example.com } /anymail/mandrill/tracking/ `
204+
205+ * *random:random * is an :setting: `ANYMAIL_WEBHOOK_AUTHORIZATION ` shared secret
206+ * *yoursite.example.com * is your Django site
207+
208+ 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.
210+
211+ 2. Mandrill will provide you a "webhook authentication key" once it verifies the URL
212+ is working. Add this to your Django project's Anymail settings under
213+ :setting: `MANDRILL_WEBHOOK_KEY <ANYMAIL_MANDRILL_WEBHOOK_KEY> `.
214+ (You may also need to set :setting: `MANDRILL_WEBHOOK_URL <ANYMAIL_MANDRILL_WEBHOOK_URL> `
215+ depending on your server config.) Then deploy your project again.
203216
204217Mandrill implements webhook signing on the entire event payload, and Anymail will
205- verify the signature. You must set :setting: `ANYMAIL_MANDRILL_WEBHOOK_KEY ` to the
206- webhook key authentication key issued by Mandrill. You may also need to set
207- :setting: `ANYMAIL_MANDRILL_WEBHOOK_URL ` depending on your server config.
218+ verify the signature. Until the correct webhook key is set, Anymail will raise
219+ an exception for any webhook calls from Mandrill (other than the initial validation request).
208220
209221Mandrill will report these Anymail :attr: `~anymail.signals.AnymailTrackingEvent.event_type `\s :
210222sent, rejected, deferred, bounced, opened, clicked, complained, unsubscribed. Mandrill does
0 commit comments