mirror of
https://github.com/pacnpal/django-anymail.git
synced 2025-12-20 03:41:05 -05:00
SendGrid: Set to field when using merge_data (#14)
* Set to field when using merge_data The `to` field is required even if providing recipient addresses in x-smtpapi. See https://sendgrid.com/docs/API_Reference/Web_API/mail.html#-send. * Check data['to'] contains expected emails * Add space for toname check * Make `to` expected data contain email only
This commit is contained in:
committed by
Mike Edmunds
parent
23becd35a9
commit
72d899460c
@@ -100,6 +100,7 @@ class SendGridPayload(RequestsPayload):
|
||||
self.set_recipients('to', self.to_list)
|
||||
else:
|
||||
# Merge-friendly smtpapi 'to' field
|
||||
self.set_recipients('to', self.to_list)
|
||||
self.smtpapi['to'] = [email.address for email in self.to_list]
|
||||
self.all_recipients += self.to_list
|
||||
|
||||
|
||||
Reference in New Issue
Block a user