Skip to content

Commit

Permalink
email from_name defaults to app_desc
Browse files Browse the repository at this point in the history
  • Loading branch information
caronc committed Mar 12, 2018
1 parent b18cc90 commit 5fafd3f
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions Notify/apprise/plugins/NotifyEmail.py
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ def __init__(self, to, notify_format, **kwargs):

# Now we want to construct the To and From email
# addresses from the URL provided
self.from_name = kwargs.get('name', self.app_desc)
self.from_name = kwargs.get('name', None)
self.from_addr = kwargs.get('from', None)

if not NotifyBase.is_email(self.to_addr):
Expand Down Expand Up @@ -234,8 +234,12 @@ def notify(self, title, body, **kwargs):
Perform Email Notification
"""

from_name = self.from_name
if not from_name:
from_name = self.app_desc

self.logger.debug('Email From: %s <%s>' % (
self.from_addr, self.from_name))
self.from_addr, from_name))
self.logger.debug('Email To: %s' % (self.to_addr))
self.logger.debug('Login ID: %s' % (self.user))
self.logger.debug('Delivery: %s:%d' % (self.smtp_host, self.port))
Expand All @@ -250,7 +254,7 @@ def notify(self, title, body, **kwargs):
email['Content-Type'] = 'text/plain'

email['Subject'] = title
email['From'] = '%s <%s>' % (self.from_name, self.from_addr)
email['From'] = '%s <%s>' % (from_name, self.from_addr)
email['To'] = self.to_addr
email['Date'] = datetime.utcnow()\
.strftime("%a, %d %b %Y %H:%M:%S +0000")
Expand Down

0 comments on commit 5fafd3f

Please sign in to comment.