Digest translation improvement (#14026)

This commit is contained in:
Charles-Henri Decultot 2018-05-16 07:15:03 +02:00 committed by Rushabh Mehta
parent 8501010f12
commit 471dea0d10

View File

@ -53,17 +53,19 @@ class EmailDigest(Document):
if recipients:
for user_id in recipients:
frappe.set_user(user_id)
msg_for_this_receipient = self.get_msg_html()
if msg_for_this_receipient:
frappe.set_user_lang(user_id)
msg_for_this_recipient = self.get_msg_html()
if msg_for_this_recipient:
frappe.sendmail(
recipients=user_id,
subject=_("{frequency} Digest").format(frequency=self.frequency),
message=msg_for_this_receipient,
subject=_("{0} Digest").format(self.frequency),
message=msg_for_this_recipient,
reference_doctype = self.doctype,
reference_name = self.name,
unsubscribe_message = _("Unsubscribe from this Email Digest"))
frappe.set_user(original_user)
frappe.set_user_lang(original_user)
def get_msg_html(self):
"""Build email digest content"""