aboutsummaryrefslogtreecommitdiffstats
path: root/lib/srtgui/views.py
diff options
context:
space:
mode:
Diffstat (limited to 'lib/srtgui/views.py')
-rw-r--r--lib/srtgui/views.py12
1 files changed, 8 insertions, 4 deletions
diff --git a/lib/srtgui/views.py b/lib/srtgui/views.py
index 088a716d..dc8f7642 100644
--- a/lib/srtgui/views.py
+++ b/lib/srtgui/views.py
@@ -1539,24 +1539,28 @@ def xhr_notifications(request):
i,notify.category,notify.get_priority_text,"%s://%s%s" % (request.scheme,request.get_host(),notify.url),notify.description,)
# Get email addresses
for nu in notify.todo2user.all():
- if 'All' == nu.user.name:
+ if 'All' == nu.user.username:
continue
if not nu.user.email:
continue
to_emails[nu.user.email] = 1
_log("NOTIFICATION EMAILS:\n%s\n%s\n" % (msg,to_emails.keys()))
if len(to_emails.keys()):
+ # If SrtSetting pass user,password,fromaddr,server else expect from environment
result_returncode,result_stdout,result_stderr = execute_process(
- 'bin/srtool_email.py',
+ 'bin/common/srtool_email.py',
'--to=%s' % ','.join(to_emails.keys()),
- '--from=%s' % 'david.reyna@windriver.com',
+ '--from=%s' % SrtSetting.get_setting('SRT_EMAIL_FROM',''),
+ '--user=%s' % SrtSetting.get_setting('SRT_EMAIL_USER',''),
+ '--passwd=%s' % SrtSetting.get_setting('SRT_EMAIL_PASSWD',''),
+ '--server=%s' % SrtSetting.get_setting('SRT_EMAIL_SMTP',''),
'--tls',
'-m=%s' % msg,
'-s=%s' % 'Message from SRTool',
)
_log("SRT_EMAIL=%s|%s|%s" % (result_returncode,result_stdout,result_stderr))
if 0 != result_returncode:
- results_msg = "ERROR:email:%s,%s" % (result_returncode,result_stderr)
+ results_msg = "ERROR:email:%s,'%s','%s'" % (result_returncode,result_stderr,result_stdout)
else:
results_msg = "Emails sent to %s" % ','.join(to_emails.keys())
else: