From c730a7b1ec0c4304b5c95264abb49ad5f35166ed Mon Sep 17 00:00:00 2001 From: Carlos Lopez Date: Wed, 17 Jun 2020 08:53:02 -0600 Subject: [PATCH] Sending subject and using default sender --- config/default.py | 1 + crc/scripts/email.py | 5 +++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/config/default.py b/config/default.py index 9a606a4c..3faaef7b 100644 --- a/config/default.py +++ b/config/default.py @@ -45,6 +45,7 @@ LDAP_URL = environ.get('LDAP_URL', default="ldap.virginia.edu").strip('/') # No LDAP_TIMEOUT_SEC = int(environ.get('LDAP_TIMEOUT_SEC', default=1)) # Email configuration +DEFAULT_SENDER = 'askresearch@virginia.edu' FALLBACK_EMAILS = ['askresearch@virginia.edu', 'sartographysupport@googlegroups.com'] MAIL_DEBUG = environ.get('MAIL_DEBUG', default=True) MAIL_SERVER = environ.get('MAIL_SERVER', default='smtp.mailtrap.io') diff --git a/crc/scripts/email.py b/crc/scripts/email.py index 3dc9cb11..18e5df86 100644 --- a/crc/scripts/email.py +++ b/crc/scripts/email.py @@ -1,5 +1,6 @@ from jinja2 import Template +from crc import app from crc.api.common import ApiError from crc.scripts.script import Script from crc.services.ldap_service import LdapService @@ -29,8 +30,8 @@ Email Subject ApprvlApprvr1 PIComputingID content = self.get_content(task) if recipients: send_mail( - subject='Test Subject', - sender='sender@sartography.com', + subject=subject, + sender=app.config['DEFAULT_SENDER'], recipients=recipients, content=content, content_html=content