anymail / django-anymail

Django email backends and webhooks for Amazon SES, Brevo (Sendinblue), MailerSend, Mailgun, Mailjet, Postmark, Postal, Resend, SendGrid, SparkPost, Unisender Go and more
https://anymail.dev
BSD 3-Clause "New" or "Revised" License
1.7k stars 130 forks source link

Feature request: update mailjet's doc with example #320

Closed badpenguin closed 1 year ago

badpenguin commented 1 year ago

I was worried to patch the library for supporting URLTags, customID and CustomCampaign, etc. But it seems that it works by just putting them in Globals instead of Messages. So maybe you want to update mailjet's doc about this:

    email.esp_extra = {
        "Globals": {
            "CustomID": "123456",
            "CustomCampaign": "validation_message",
            "URLTags": "utm_source=mailjet&utm_medium=email&utm_campaign=validation&utm_content=test1&utm_term=v1",
        }
    }
medmunds commented 1 year ago

To set a Mailjet CustomCampaign, use Anymail's tags option.

Although you can use a Mailjet CustomID as in your example, a more portable option is Anymail's message_id. Anymail supports this for Mailjet and all other ESPs. (For Mailjet, message_id maps to their “legacy” MessageID, which is also provided to webhooks.)

Using other Mailjet features not directly supported by Anymail is documented here: https://anymail.dev/en/stable/esps/mailjet/#esp-extra-support. If you'd like to update the example to include URLTags, a PR is welcome.