Skip to content

Commit

Permalink
email sender values updated
Browse files Browse the repository at this point in the history
  • Loading branch information
sourovamin committed Nov 28, 2024
1 parent f409b96 commit 027e968
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 7 deletions.
2 changes: 2 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ services:
# MAIL_PASSWORD: ${MAIL_PASSWORD}
# MAIL_SERVER: mail.age.mpg.de
MAIL_USERNAME: [email protected]
MAIL_USERNAME_ADDRESS: [email protected]
links:
- mariadb
depends_on:
Expand Down Expand Up @@ -161,6 +162,7 @@ services:
# MAIL_PORT: 587
# MAIL_SERVER: mail.age.mpg.de
MAIL_USERNAME: [email protected]
MAIL_USERNAME_ADDRESS: [email protected]
ADMINS: [email protected]
# MAIL_USE_TLS: '1'
MYSQL_HOST: mariadb
Expand Down
4 changes: 3 additions & 1 deletion kubernetes/server-deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -71,9 +71,11 @@ spec:
- name: MAIL_PORT
value: "587"
- name: MAIL_SERVER
value: mail.age.mpg.de
value: mail.ox.gwdg.de
- name: MAIL_USERNAME
value: [email protected]
- name: MAIL_USERNAME_ADDRESS
value: [email protected]
- name: MAIL_USE_TLS
value: "1"
- name: MYSQL_HOST
Expand Down
3 changes: 2 additions & 1 deletion production-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -69,8 +69,9 @@ services:
FLASK_ENV: production
MAIL_PASSWORD: ${MAIL_PASSWORD}
MAIL_PORT: 587
MAIL_SERVER: mail.age.mpg.de
MAIL_SERVER: mail.ox.gwdg.de
MAIL_USERNAME: [email protected]
MAIL_USERNAME_ADDRESS: [email protected]
ADMINS: [email protected]
MAIL_USE_TLS: '1'
MYSQL_HOST: mariadb
Expand Down
8 changes: 4 additions & 4 deletions routes/apps/_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -412,7 +412,7 @@ def make_except_toast(text=None,id=None,e=None,user=None, eapp=None):
emsg_html=tb_str.split("\n")
send_email(
'[Flaski] exception: %s ' %eapp,
sender=app.config['MAIL_USERNAME'],
sender=app.config['MAIL_USERNAME_ADDRESS'],
recipients=app.config['ADMINS'],
text_body=render_template(
'email/app_exception.txt',
Expand Down Expand Up @@ -518,7 +518,7 @@ def ask_for_help(tb_str, user, current_app, session_data=None ):
session_file_name="no session data for this Exception"

send_email('[Flaski] help needed: %s ' %current_app,
sender=app.config['MAIL_USERNAME'],
sender=app.config['MAIL_USERNAME_ADDRESS'],
recipients=app.config['ADMINS'],
text_body=render_template('email/app_help.txt',
user=user, eapp=current_app, emsg=tb_str, etime=str(datetime.now()), session_file=session_file_name),
Expand All @@ -529,7 +529,7 @@ def ask_for_help(tb_str, user, current_app, session_data=None ):
def send_submission_email(user,submission_type,submission_tag, submission_file=None, attachment_path=None,open_type="rb",attachment_type="application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"):
with app.app_context():
send_email('[Flaski][Automation][{submission_type}] Files have been submited for analysis.'.format(submission_type=submission_type),
sender=app.config['MAIL_USERNAME'],
sender=app.config['MAIL_USERNAME_ADDRESS'],
recipients=[user.email, '[email protected]' ],
text_body=render_template('email/submissions.age.txt',
user=user, submission_type=submission_type, submission_tag=submission_tag),
Expand Down Expand Up @@ -608,7 +608,7 @@ def send_submission_ftp_email(user,submission_type,submission_tag, submission_fi

with app.app_context():
send_email('[Flaski][Automation][{submission_type}] Files have been submited for analysis.'.format(submission_type=submission_type),
sender=app.config['MAIL_USERNAME'],
sender=app.config['MAIL_USERNAME_ADDRESS'],
recipients=[user.email, '[email protected]' ],
text_body=render_template('email/submissions.ftp.txt',
user=user,
Expand Down
2 changes: 1 addition & 1 deletion routes/apps/transfer.py
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,7 @@ def release_request(n_clicks, pathname):
submission_tag=os.path.basename(dest)

send_email(f'[Flaski][Automation][{submission_type}] Files have been transfered.',
sender=app.config['MAIL_USERNAME'],
sender=app.config['MAIL_USERNAME_ADDRESS'],
recipients=[user.email, '[email protected]' ],
text_body=render_template('email/submissions.ftp.data.txt',
user=user, filename=os.path.basename(submission_tag), submission_tag=submission_tag, submission_type=submission_type),
Expand Down

0 comments on commit 027e968

Please sign in to comment.