Tweak flash message when sending email preview, in case it's disabled

This commit is contained in:
Lance Edgar 2016-12-10 14:54:30 -06:00
parent ed4c445fbe
commit 35d1c24bc7

View file

@ -226,9 +226,10 @@ class EmailPreview(View):
del msg['Bcc']
msg['To'] = recipient
mail.deliver_message(self.rattail_config, msg)
sent = mail.deliver_message(self.rattail_config, key, msg)
self.request.session.flash("Preview for '{0}' was emailed to {1}".format(key, recipient))
self.request.session.flash("Preview for '{}' was {}emailed to {}".format(
key, '' if sent else '(NOT) ', recipient))
def preview_template(self, key, type_):
email = mail.get_email(self.rattail_config, key)