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.67k stars 129 forks source link

SendInBlue's scheduled email sending using "scheduledAt" #280

Closed dimitrisor closed 1 year ago

dimitrisor commented 2 years ago

In your documentation, and more specifically in Supported ESPs > SendInBlue > Limitations and quirks > No delayed sending, it is mentioned that "delayed sending" is not supported in Sendinblue ("Sendinblue does not support send_at"), however, in the official documentation of SendInBlue, I have found that individual scheduled messages can be sent using the "scheduledAt" field.

Could you confirm that this is valid, and If it is, can you also update Anymail's docs and code?

Also, given the opportunity, I'd like to thank you for the great work :)

medmunds commented 2 years ago

@dimitrisor thanks for the pointer. Looks like Sendinblue introduced scheduled sending a few months ago. (And they're still describing the feature as a "beta" in their main docs.)

First, if you need this right away, Anymail's esp_extra allows using new ESP features before Anymail's code catches up:

send_at = datetime.datetime(..., tzinfo=...)  # be sure to use a timezone
message.esp_extra = {"scheduledAt": send_at.isoformat(timespec="seconds")}

But yes, we should definitely update Anymail. I'm finishing up some other projects and won't be able get to this for a couple of weeks. If you'd like to give it a try before then, you could: