| |
@@ -1,7 +1,11 @@
|
| |
from email.message import EmailMessage
|
| |
+ import logging
|
| |
import smtplib
|
| |
|
| |
|
| |
+ _log = logging.getLogger(__name__)
|
| |
+
|
| |
+
|
| |
def notify_packager(mail_server, admin_email, username, email):
|
| |
|
| |
message = f"""Hello {username},
|
| |
@@ -86,6 +90,7 @@
|
| |
address given with the subject and content and via the given email server.
|
| |
"""
|
| |
|
| |
+ _log.info("Sending email to %s about: %s", to_addresses, subject)
|
| |
msg = EmailMessage()
|
| |
msg.add_header("To", ", ".join(to_addresses))
|
| |
msg.add_header("From", from_address)
|
| |
@@ -95,3 +100,4 @@
|
| |
smtp = smtplib.SMTP(mail_server)
|
| |
smtp.sendmail(from_address, to_addresses, msg.as_string())
|
| |
smtp.quit()
|
| |
+ _log.info("email sent")
|
| |
Signed-off-by: Pierre-Yves Chibon pingou@pingoured.fr