Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Notify user with failing addresses when emailing of results reports #1422

Merged
merged 3 commits into from
Aug 13, 2019

Conversation

xispa
Copy link
Member

@xispa xispa commented Aug 12, 2019

Description of the issue/feature this PR addresses

Notifies the user with the unsuccessful email addresses when emailing results reports.

Linked issue: #1423

Current behavior before PR

User receives a warning stating "Failed to send Email(s)", but without any further information

Desired behavior after PR is merged

User receives the same warning as above, plus the list of addresses for which the emailing failed

--
I confirm I have tested this PR thoroughly and coded it according to PEP8
and Plone's Python styleguide standards.

@@ -510,7 +510,9 @@ def send_email(self, recipients, subject, body, attachments=None):
attachments=attachments)
sent = mailapi.send_email(mime_msg)
if not sent:
logger.error("Could not send email to {}".format(pair))
msg = "Could not send email to {}".format(pair)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm just wondering if this message also works for email, name pairs which contain unicode characters. Can you try that please with a recipient name that contains unicode characters?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the heads-up!. Just added this commit:
077dd13

And this is what I get when using pairs containing unicode chars:

Captura de 2019-08-13 21-31-39

Copy link
Contributor

@ramonski ramonski left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@ramonski ramonski merged commit 86fce19 into master Aug 13, 2019
@ramonski ramonski deleted the notify-failed-email branch August 13, 2019 19:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

Successfully merging this pull request may close these issues.

2 participants