SendGrid: support multiple reply_to

Closes #325
This commit is contained in:
Mike Edmunds
2023-07-27 18:33:27 -07:00
parent c8a5e13c89
commit 05afde0651
5 changed files with 17 additions and 38 deletions

View File

@@ -254,11 +254,8 @@ class SendGridPayload(RequestsPayload):
self.data["subject"] = subject
def set_reply_to(self, emails):
# SendGrid only supports a single address in the reply_to API param.
if len(emails) > 1:
self.unsupported_feature("multiple reply_to addresses")
if len(emails) > 0:
self.data["reply_to"] = self.email_object(emails[0])
if emails:
self.data["reply_to_list"] = [self.email_object(email) for email in emails]
def set_extra_headers(self, headers):
# SendGrid requires header values to be strings -- not integers.