diff --git a/auto_merger/email.py b/auto_merger/email.py index 343afe1..7cea4c0 100644 --- a/auto_merger/email.py +++ b/auto_merger/email.py @@ -29,20 +29,23 @@ from typing import List +DEFAULT_MAILS = ["phracek@redhat.com", "sclorg@redhat.com"] + + class EmailSender: - def __init__(self, recipient_email: List[str]): + def __init__(self, recipient_email: List[str] = None): self.recipient_email = recipient_email self.mime_msg = MIMEMultipart() - def send_email(self, subject_msg, body: List[str]): + def send_email(self, subject_msg, body: List[str] = None): send_from = "phracek@redhat.com" - send_to = self.recipient_email - print(body) + send_to = DEFAULT_MAILS + if self.recipient_email is not None: + send_to.extend(self.recipient_email) whole_body = "".join(body) msg = ("" f"{whole_body}") - print(msg) self.mime_msg["From"] = send_from self.mime_msg["To"] = ", ".join(send_to) self.mime_msg["Subject"] = subject_msg