Revert "fix: email digest user not found"
This reverts commit 188657d05a
.
This commit is contained in:
parent
c21ce42559
commit
52ea6b126b
@ -50,8 +50,12 @@ class EmailDigest(Document):
|
|||||||
recipients = list(filter(lambda r: r in valid_users,
|
recipients = list(filter(lambda r: r in valid_users,
|
||||||
self.recipient_list.split("\n")))
|
self.recipient_list.split("\n")))
|
||||||
|
|
||||||
|
original_user = frappe.session.user
|
||||||
|
|
||||||
if recipients:
|
if recipients:
|
||||||
for user_id in recipients:
|
for user_id in recipients:
|
||||||
|
frappe.set_user(user_id)
|
||||||
|
frappe.set_user_lang(user_id)
|
||||||
msg_for_this_recipient = self.get_msg_html()
|
msg_for_this_recipient = self.get_msg_html()
|
||||||
if msg_for_this_recipient:
|
if msg_for_this_recipient:
|
||||||
frappe.sendmail(
|
frappe.sendmail(
|
||||||
@ -62,6 +66,9 @@ class EmailDigest(Document):
|
|||||||
reference_name = self.name,
|
reference_name = self.name,
|
||||||
unsubscribe_message = _("Unsubscribe from this Email Digest"))
|
unsubscribe_message = _("Unsubscribe from this Email Digest"))
|
||||||
|
|
||||||
|
frappe.set_user(original_user)
|
||||||
|
frappe.set_user_lang(original_user)
|
||||||
|
|
||||||
def get_msg_html(self):
|
def get_msg_html(self):
|
||||||
"""Build email digest content"""
|
"""Build email digest content"""
|
||||||
frappe.flags.ignore_account_permission = True
|
frappe.flags.ignore_account_permission = True
|
||||||
|
Loading…
Reference in New Issue
Block a user