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

Home Page:https://anymail.dev

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Mailjet Open tracking?

torusservices opened this issue · comments

I do not see any open tracking specifically with Mailjet, on Sendinblue it works by default. But Mailjet not even on their side there doesn't seem to be any open tracking. Even tho it is enabled on the fresh account.

  • Anymail version (latest)
  • ESP (Mailjet)

from django.core.mail import send_mail, get_connection
from django.http import HttpResponse

def send_email_view(request):
   
#     You can even use multiple Anymail backends in the same app:
    mailjet_backend = get_connection('anymail.backends.mailjet.EmailBackend',)
    send_mail("",
            "",
            "",
            [""],
            connection=mailjet_backend)


    return HttpResponse("Email sent successfully!") 

mind you delivered tracking is working

Open tracking works by adding an invisible <img> tracking pixel to the html part of the email. If your email only includes plain text, not html, the behavior depends on your ESP. Some ESPs (like Sendinblue apparently) will convert your plain text to html, and include the tracking pixel in that. Other ESPs (like Mailjet) send a text-only message, which won't have a tracking pixel so won't generate open events.

If you want to use open or click tracking, it's best to send email that includes both html and text parts:

send_mail(
    "subject", 
    "text message", 
    "from@example.com", 
    ["to@example.com"], 
    html_message="html message"  # <--
)

@torusservices if that didn't solve your problem, please reopen with additional details to reproduce

No you clarified it perfectly sorry about forgetting to reply that you helped!