Skip to content
Merged

save #45

Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 13 additions & 12 deletions src/rda_python_common/PgLOG.py
Original file line number Diff line number Diff line change
Expand Up @@ -271,18 +271,19 @@ def send_customized_email(logmsg, emlmsg, logact = LOGWRN):
return pglog("{}Missing Entry '{}' for sending email".format(logmsg, entry), logact|ERRLOG)

ret = send_python_email(entries['sb'][2], entries['to'][2], msg, entries['fr'][2], entries['cc'][2], logact)

if ret != SUCCESS and PGLOG['EMLSEND']:
ret = pgsystem(PGLOG['EMLSEND'], logact, 4, emlmsg)
logmsg += "Email " + entries['to'][2]
if entries['cc'][2]: logmsg += " Cc'd " + entries['cc'][2]
logmsg += " Subject: " + entries['sb'][2]
if ret:
log_email(emlmsg)
pglog(logmsg, logact&(~EXITLG))
else:
errmsg = "Error sending email: " + logmsg
pglog(errmsg, (logact|ERRLOG)&~EXITLG)
if ret == SUCCESS or not PGLOG['EMLSEND']: return ret

# try commandline sendmail
ret = pgsystem(PGLOG['EMLSEND'], logact, 4, emlmsg)
logmsg += "Email " + entries['to'][2]
if entries['cc'][2]: logmsg += " Cc'd " + entries['cc'][2]
logmsg += " Subject: " + entries['sb'][2]
if ret:
log_email(emlmsg)
pglog(logmsg, logact&(~EXITLG))
else:
errmsg = "Error sending email: " + logmsg
pglog(errmsg, (logact|ERRLOG)&~EXITLG)

return ret

Expand Down