mirror of
https://github.com/pacnpal/django-anymail.git
synced 2025-12-20 03:41:05 -05:00
Sendinblue: Support send_at
Add support for delayed sending via Sendinblue's public beta "scheduledAt" parameter. Closes #280
This commit is contained in:
@@ -162,3 +162,10 @@ class SendinBluePayload(RequestsPayload):
|
||||
def set_metadata(self, metadata):
|
||||
# SendinBlue expects a single string payload
|
||||
self.data['headers']["X-Mailin-custom"] = self.serialize_json(metadata)
|
||||
|
||||
def set_send_at(self, send_at):
|
||||
try:
|
||||
start_time_iso = send_at.isoformat(timespec="milliseconds")
|
||||
except (AttributeError, TypeError):
|
||||
start_time_iso = send_at # assume user already formatted
|
||||
self.data['scheduledAt'] = start_time_iso
|
||||
|
||||
Reference in New Issue
Block a user