Sending subject and using default sender

This commit is contained in:
Carlos Lopez 2020-06-17 08:53:02 -06:00
parent 2ff836019f
commit c730a7b1ec
2 changed files with 4 additions and 2 deletions

View File

@ -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)) LDAP_TIMEOUT_SEC = int(environ.get('LDAP_TIMEOUT_SEC', default=1))
# Email configuration # Email configuration
DEFAULT_SENDER = 'askresearch@virginia.edu'
FALLBACK_EMAILS = ['askresearch@virginia.edu', 'sartographysupport@googlegroups.com'] FALLBACK_EMAILS = ['askresearch@virginia.edu', 'sartographysupport@googlegroups.com']
MAIL_DEBUG = environ.get('MAIL_DEBUG', default=True) MAIL_DEBUG = environ.get('MAIL_DEBUG', default=True)
MAIL_SERVER = environ.get('MAIL_SERVER', default='smtp.mailtrap.io') MAIL_SERVER = environ.get('MAIL_SERVER', default='smtp.mailtrap.io')

View File

@ -1,5 +1,6 @@
from jinja2 import Template from jinja2 import Template
from crc import app
from crc.api.common import ApiError from crc.api.common import ApiError
from crc.scripts.script import Script from crc.scripts.script import Script
from crc.services.ldap_service import LdapService from crc.services.ldap_service import LdapService
@ -29,8 +30,8 @@ Email Subject ApprvlApprvr1 PIComputingID
content = self.get_content(task) content = self.get_content(task)
if recipients: if recipients:
send_mail( send_mail(
subject='Test Subject', subject=subject,
sender='sender@sartography.com', sender=app.config['DEFAULT_SENDER'],
recipients=recipients, recipients=recipients,
content=content, content=content,
content_html=content content_html=content