summaryrefslogtreecommitdiff
path: root/service/pixelated
diff options
context:
space:
mode:
authorPatrick Maia <pixelated-team+pmaia@thoughtworks.com>2014-10-23 19:15:03 -0300
committerVictor Shyba <victor.shyba@gmail.com>2014-10-24 10:22:03 -0300
commite72e8ab515931f294523e836693eb76358fed240 (patch)
treefe75da953b49296c44559539c220becb2e47604c /service/pixelated
parent7ce93f2d1d4568e4cd5284209fb28f578b2978b3 (diff)
Card #30 - handles alternative bodies on InputMail
Diffstat (limited to 'service/pixelated')
-rw-r--r--service/pixelated/adapter/mail.py6
1 files changed, 5 insertions, 1 deletions
diff --git a/service/pixelated/adapter/mail.py b/service/pixelated/adapter/mail.py
index f21ed2ef..fdfeda89 100644
--- a/service/pixelated/adapter/mail.py
+++ b/service/pixelated/adapter/mail.py
@@ -155,7 +155,11 @@ class InputMail(Mail):
mime_multipart['Subject'] = self.headers['Subject']
mime_multipart['Date'] = self.headers['Date']
- mime_multipart.attach(MIMEText(self.body, 'plain'))
+ if type(self.body) is list:
+ for part in self.body:
+ mime_multipart.attach(MIMEText(part['raw'], part['content-type']))
+ else:
+ mime_multipart.attach(MIMEText(self.body, 'plain'))
return mime_multipart
def to_smtp_format(self):