Commit 6fdb76cd authored by Markus Scheidgen's avatar Markus Scheidgen
Browse files

Added email cc for after processing email.

parent 3b1e168d
......@@ -158,7 +158,8 @@ mail = NomadConfig(
port=8995,
user='',
password='',
from_address='webmaster@nomad-coe.eu'
from_address='webmaster@nomad-coe.eu',
cc_address='webmaster@nomad-coe.eu'
)
normalize = NomadConfig(
......
......@@ -426,10 +426,15 @@ def send_mail(name: str, email: str, message: str, subject: str):
msg['Subject'] = subject
msg['From'] = 'The nomad team <%s>' % config.mail.from_address
msg['To'] = name
to_addrs = [email]
if config.mail.cc_address is not None:
msg['Cc'] = 'The nomad team <%s>' % config.mail.cc_address
to_addrs.append(config.mail.cc_address)
try:
server.send_message(msg, config.mail.from_address, email)
server.send_message(msg, from_addr=config.mail.from_address, to_addrs=to_addrs)
except Exception as e:
logger.error('Could send email', exc_info=e)
logger.error('Could not send email', exc_info=e)
server.quit()
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment