Skip to content

Commit bc7216d

Browse files
committed
Modified add_header() to accept dict types. (issue #997)
1 parent 7eafe18 commit bc7216d

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

sendgrid/helpers/mail/mail.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -464,7 +464,8 @@ def add_header(self, header):
464464
:param value: A Header object or a dict of header key/values
465465
:type value: Header, dict
466466
"""
467-
if header.personalization is not None:
467+
if (isinstance(header, Header) and header.personalization is not None) or (
468+
isinstance(header, dict) and header.get('personalization')):
468469
try:
469470
personalization = \
470471
self._personalizations[header.personalization]

0 commit comments

Comments
 (0)