##// END OF EJS Templates
implements #291 email notification sent to all admin users
marcink -
r1642:c0d8171a default
parent child Browse files
Show More
@@ -47,7 +47,7 b' from rhodecode.lib.compat import json, O'
47
47
48 from rhodecode.model import init_model
48 from rhodecode.model import init_model
49 from rhodecode.model import meta
49 from rhodecode.model import meta
50 from rhodecode.model.db import RhodeCodeUi, Statistics, Repository
50 from rhodecode.model.db import RhodeCodeUi, Statistics, Repository, User
51
51
52 from vcs.backends import get_repo
52 from vcs.backends import get_repo
53
53
@@ -346,7 +346,9 b' def send_email(recipients, subject, body'
346 email_config = config
346 email_config = config
347
347
348 if not recipients:
348 if not recipients:
349 recipients = [email_config.get('email_to')]
349 # if recipients are not defined we send to email_config + all admins
350 admins = [u.email for u in User.query().filter(User.admin==True).all()]
351 recipients = [email_config.get('email_to')] + admins
350
352
351 mail_from = email_config.get('app_email_from')
353 mail_from = email_config.get('app_email_from')
352 user = email_config.get('smtp_username')
354 user = email_config.get('smtp_username')
General Comments 0
You need to be logged in to leave comments. Login now