From 4b15b31e51851ded29e7ce68db636f719ca0cfd8 Mon Sep 17 00:00:00 2001 From: Vincent Fretin Date: Wed, 1 Sep 2010 07:32:28 +0000 Subject: [PATCH] Translate the subject and be sure to set the charset to utf-8 for the mail. svn path=/plone.app.discussion/trunk/; revision=39587 --- plone/app/discussion/comment.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/plone/app/discussion/comment.py b/plone/app/discussion/comment.py index 723516a..ab42cb9 100644 --- a/plone/app/discussion/comment.py +++ b/plone/app/discussion/comment.py @@ -197,7 +197,8 @@ def notify_user(obj, event): for comment in conversation.getComments(): if obj != comment and \ comment.author_notification and comment.author_email: - subject = _(u"A comment has been posted.") + subject = translate(_(u"A comment has been posted."), + context=obj.REQUEST) message = translate(Message(MAIL_NOTIFICATION_MESSAGE, mapping={'title': obj.title, 'link': content_object.absolute_url()}), @@ -244,7 +245,7 @@ def notify_moderator(obj, event): # Compose email #comment = conversation.getComments().next() - subject = _(u"A comment has been posted.") + subject = translate(_(u"A comment has been posted."), context=obj.REQUEST) message = translate(Message(MAIL_NOTIFICATION_MESSAGE, mapping={'title': obj.title, 'link': content_object.absolute_url()}), @@ -252,6 +253,6 @@ def notify_moderator(obj, event): # Send email if PLONE_4: - mail_host.send(message, mto, sender, subject) + mail_host.send(message, mto, sender, subject, charset='utf-8') else: - mail_host.secureSend(message, mto, sender, subject=subject) + mail_host.secureSend(message, mto, sender, subject=subject, charset='utf-8')