Skip to content
Snippets Groups Projects
Unverified Commit 101659dc authored by Ravi Tripathi's avatar Ravi Tripathi Committed by GitHub
Browse files

Merge pull request #84 from diedpigs/feat-admin-mail-subject

Add result of create to email subject
parents 8b27dccc 0268e6a0
No related branches found
No related tags found
2 merge requests!147Merge previous default branch feat-cod-rmq into main,!88Feat cod rmq
......@@ -25,5 +25,5 @@ Whole_mail = Head + Body
UserReportHead = f"""From: {rcfg.Sender_alias} <{rcfg.Sender}>
To: <{rcfg.Admin_email}>
Subject: RC Account Creation Report: {{{{ fullname }}}}, {{{{ username }}}} """
Subject: [{{{{ result }}}}]RC Account Creation Report: {{{{ fullname }}}}, {{{{ username }}}} """
......@@ -52,7 +52,15 @@ rc_rmq = RCRMQ({'exchange': 'RegUsr', 'exchange_type': 'topic'})
def notify_admin(username, user_record):
receivers = [rcfg.Admin_email]
message = Template(mail_cfg.UserReportHead).render(username=username, fullname=user_record['fullname'])
result = "SUCCESS" if user_record["request"]["create_account"] and\
user_record["verify"]["git_commit"] and\
user_record["verify"]["dir_verify"] and\
user_record["verify"]["subscribe_mail_list"] and\
user_record["notify"]["notify_user"]\
else "FAILED"
message = Template(mail_cfg.UserReportHead).render(username=username, fullname=user_record['fullname'], result=result)
if user_record['reported']:
message += ' (Duplicate)'
message += f""" \n
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment