seitime-frappe/frappe/patches/v12_0/remove_example_email_thread_notify.py
Chinmay D. Pai f12ed9791a
fix: remove example users email ids from notifications
currently the system tries sending emails to all users that have
'thread_notify' enabled, including the default example emails that the
Administrator and Guest accounts have. this patch disables email
notifications for these accounts, and additionally tries to disable it
for any other user accounts with example emails

Signed-off-by: Chinmay D. Pai <chinmaydpai@gmail.com>
2020-07-17 11:32:02 +05:30

8 lines
208 B
Python

import frappe
def execute():
# remove all example.com email user accounts from notifications
frappe.db.sql("""UPDATE `tabUser`
SET thread_notify=0, send_me_a_copy=0
WHERE email like '%@example.com'""")