From cad4bbf073663db828fa7ac43b27ae00556e2797 Mon Sep 17 00:00:00 2001 From: Jefferson Stachelski Date: Fri, 30 Jan 2015 14:04:16 -0200 Subject: 249 Implemented a feature that send an email when something was wrong to send email --- service/pixelated/adapter/model/mail.py | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'service/pixelated/adapter/model/mail.py') diff --git a/service/pixelated/adapter/model/mail.py b/service/pixelated/adapter/model/mail.py index 42953064..dfc0ea1c 100644 --- a/service/pixelated/adapter/model/mail.py +++ b/service/pixelated/adapter/model/mail.py @@ -185,6 +185,17 @@ class InputMail(Mail): mime_multipart['From'] = InputMail.FROM_EMAIL_ADDRESS return mime_multipart.as_string() + @staticmethod + def delivery_error_template(delivery_address): + return InputMail.from_dict({ + 'body': "Mail undelivered for %s" % delivery_address, + 'header': { + 'bcc': [], + 'cc': [], + 'subject': "Mail undelivered for %s" % delivery_address + } + }) + @staticmethod def from_dict(mail_dict): input_mail = InputMail() -- cgit v1.2.3