From f8ec5a568f08fb6e3d6b6dd789bc2dd595555329 Mon Sep 17 00:00:00 2001 From: Gabriel Date: Fri, 21 Jun 2019 16:50:44 -0300 Subject: [PATCH] Fixed CC Recipients --- workflows/Ews2Case.py | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/workflows/Ews2Case.py b/workflows/Ews2Case.py index d4aced3..18e893c 100644 --- a/workflows/Ews2Case.py +++ b/workflows/Ews2Case.py @@ -131,20 +131,23 @@ def getEmailBody(email): #Cc #Subject - to = str() #making sure that there is a recipient #because cannot iterate over None object + to = '' if email.to_recipients: for recipient in email.to_recipients: - to = to + recipient.email_address + ' ' - else: - to = '' + to = to + recipient.email_address + ' ' + + cc = '' + if email.cc_recipients: + for cc_recipient in email.cc_recipients: + cc = cc + cc_recipient.email_address + ' ' replyToInfo = ('From: ' + str(email.author.email_address).lower() + '\n' + 'Sent: ' + str(email.datetime_sent) + '\n' + 'To: ' + to.lower() + '\n' + - 'Cc: ' + str(email.display_cc).lower() + '\n' + - 'Subject: ' + str(email.subject) + '\n\n') + ('Cc: ' + cc.lower() + '\n' if cc else '') + + 'Subject: ' + str(email.subject) + '\n\n') body = email.text_body