Skip to content
Snippets Groups Projects
Verified Commit 124dc8c4 authored by Karel van Klink's avatar Karel van Klink :smiley_cat:
Browse files

Move email recipients into mailer function

parent f1e313db
No related branches found
No related tags found
No related merge requests found
...@@ -7,19 +7,18 @@ from ssl import create_default_context ...@@ -7,19 +7,18 @@ from ssl import create_default_context
from gso.settings import load_oss_params from gso.settings import load_oss_params
def send_mail(recipients: str, subject: str, body: str) -> None: def send_mail(subject: str, body: str) -> None:
"""Send an email message to the given addresses. """Send an email message to the given addresses.
Only supports STARTTLS, not SSL. Only supports STARTTLS, not SSL.
:param str recipients: The destination addresses, comma separated.
:param str subject: The email subject. :param str subject: The email subject.
:param str body: The contents of the email message. :param str body: The contents of the email message.
""" """
email_params = load_oss_params().EMAIL email_params = load_oss_params().EMAIL
msg = EmailMessage() msg = EmailMessage()
msg["From"] = email_params.from_address msg["From"] = email_params.from_address
msg["To"] = recipients msg["To"] = email_params.notification_email_destinations
msg["Subject"] = subject msg["Subject"] = subject
msg.set_content(body) msg.set_content(body)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment