Skip to content

Commit

Permalink
illogical sned_notification for email with subject
Browse files Browse the repository at this point in the history
  • Loading branch information
davebulaval committed Sep 20, 2019
1 parent ed2d371 commit 016aa1f
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions notif/notificator.py
Original file line number Diff line number Diff line change
Expand Up @@ -107,22 +107,22 @@ def __init__(self, sender_email: str, sender_login_credential: str, destination_
self.destination_email = destination_email
self.smtp_server = smtp_server

def send_notification(self, subject, text):
def send_notification(self, message):
"""
Send a notificiation message to the destination email.
Args:
subject (str): The subject to been show in the email.
text (str): The text of the email.
message (str): The message of the email.
"""
self.smtp_server.ehlo()
self.smtp_server.starttls()

self.smtp_server.login(self.sender_email, self.sender_login_credential)

content = 'Subject: %s\n\n%s' % (subject, text)
subject = "Python script notification email"
content = 'Subject: %s\n\n%s' % (subject, message)
self.smtp_server.sendmail(self.sender_email, self.destination_email, content)

self.smtp_server.close()
Expand Down

0 comments on commit 016aa1f

Please sign in to comment.