From df9227a942c1a8090bcc402da0514fe79e31d28b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jordi=20Puiggen=C3=A9?= Date: Tue, 13 Aug 2019 00:19:12 +0200 Subject: [PATCH 1/3] Notify user with failing addresses when emailing of results reports --- bika/lims/browser/publish/emailview.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/bika/lims/browser/publish/emailview.py b/bika/lims/browser/publish/emailview.py index fa216bc4ca..ce6a75f0f8 100644 --- a/bika/lims/browser/publish/emailview.py +++ b/bika/lims/browser/publish/emailview.py @@ -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) + self.add_status_message(msg, "warning") + logger.error(msg) success.append(sent) if not all(success): From 7c56e1f6c90f0d3fe688fae9728e7a1668a38cf0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jordi=20Puiggen=C3=A9?= Date: Tue, 13 Aug 2019 00:22:20 +0200 Subject: [PATCH 2/3] Changelog --- CHANGES.rst | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGES.rst b/CHANGES.rst index 858a5581f9..d911f79175 100644 --- a/CHANGES.rst +++ b/CHANGES.rst @@ -6,6 +6,7 @@ Changelog **Added** +- #1422 Notify user with failing addresses when emailing of results reports - #1420 Allow to detach a partition from its primary sample - #1410 Email API From 077dd1378e275fe8eeaddd1a03ef22d17eaa00ac Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jordi=20Puiggen=C3=A9?= Date: Tue, 13 Aug 2019 21:33:25 +0200 Subject: [PATCH 3/3] Handle unicode and translation --- bika/lims/browser/publish/emailview.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/bika/lims/browser/publish/emailview.py b/bika/lims/browser/publish/emailview.py index ce6a75f0f8..6755e2d4b6 100644 --- a/bika/lims/browser/publish/emailview.py +++ b/bika/lims/browser/publish/emailview.py @@ -510,7 +510,8 @@ def send_email(self, recipients, subject, body, attachments=None): attachments=attachments) sent = mailapi.send_email(mime_msg) if not sent: - msg = "Could not send email to {}".format(pair) + msg = _("Could not send email to {0} ({1})").format(pair[0], + pair[1]) self.add_status_message(msg, "warning") logger.error(msg) success.append(sent)