Merge pull request #538 from sartography/bug/email-data-issues-735

Bug/email data issues #735
This commit is contained in:
Dan Funk 2022-05-10 09:54:16 -04:00 committed by GitHub
commit a78bb46682
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 1 deletions

View File

@ -30,7 +30,7 @@ class EmailService(object):
# Create EmailModel
email_model = EmailModel(subject=subject, sender=sender, recipients=str(recipients),
content=content, content_html=content_html, study=study,
cc=cc, bcc=bcc, workflow_spec_id=workflow_spec_id, name=name)
cc=str(cc), bcc=str(bcc), workflow_spec_id=workflow_spec_id, name=name)
# Send mail
try:

View File

@ -27,6 +27,9 @@ class TestEmailScript(BaseTest):
'reply_to': 'reply_to@example.com', 'name': 'My Email Name'})
task = workflow_api.next_task
self.assertEqual('My Email Name', task.data['email_model']['name'])
self.assertEqual('[\'test@example.com\']', task.data['email_model']['recipients'])
self.assertEqual('[\'cc@example.com\']', task.data['email_model']['cc'])
self.assertEqual('[\'bcc@example.com\']', task.data['email_model']['bcc'])
self.assertEqual(1, len(outbox))
self.assertEqual('My Email Subject', outbox[0].subject)