Skip to content

Commit d78be6a

Browse files
author
elbuo8
committed
Added the ability to add a tuple in add_to
1 parent 12c72bb commit d78be6a

1 file changed

Lines changed: 7 additions & 1 deletion

File tree

sendgrid/message.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import io
1+
import import sys
22
import sys
33
import json
44
try:
@@ -62,6 +62,12 @@ def add_to(self, to):
6262
self.parse_and_add(to)
6363
elif sys.version_info < (3, 0) and isinstance(to, unicode):
6464
self.parse_and_add(to.encode('utf-8'))
65+
elif type(to) is tuple:
66+
if len(to) == 1:
67+
self.add_to(to[0])
68+
elif len(to) == 2:
69+
self.add_to(to[0])
70+
self.add_to_name(to[1])
6571
elif hasattr(to, '__iter__'):
6672
for email in to:
6773
self.add_to(email)

0 commit comments

Comments
 (0)