aboutsummaryrefslogtreecommitdiff
path: root/utils.py
diff options
context:
space:
mode:
authorcedricbonhomme <devnull@localhost>2010-11-23 11:40:56 +0100
committercedricbonhomme <devnull@localhost>2010-11-23 11:40:56 +0100
commit6b4eff20bea59339a5f09d807e082fc2a494dd7e (patch)
tree300a8852fa05f7bb48571b0bd36c3c25d6263410 /utils.py
parentRenamed pages list_notification and list_favorites to notifications and favor... (diff)
downloadnewspipe-6b4eff20bea59339a5f09d807e082fc2a494dd7e.tar.gz
newspipe-6b4eff20bea59339a5f09d807e082fc2a494dd7e.tar.bz2
newspipe-6b4eff20bea59339a5f09d807e082fc2a494dd7e.zip
Improvement of mail notification for new articles (HTML output).
Diffstat (limited to 'utils.py')
-rwxr-xr-xutils.py11
1 files changed, 7 insertions, 4 deletions
diff --git a/utils.py b/utils.py
index 0e71523a..2409563e 100755
--- a/utils.py
+++ b/utils.py
@@ -213,13 +213,16 @@ def tag_cloud(tags, query="word_count"):
(min(1 + count * 7 / max([tag[1] for tag in tags]), 7), query, word, count, calendar.month_name[int(word)])) \
for (word, count) in tags])
-def send_mail(mfrom, mto, feed_title, message):
- """Send the warning via mail
+def send_mail(mfrom, mto, feed_title, article_title, description):
"""
- mail = MIMEText(message)
+ Send the article via mail.
+ """
+ content = """<html>\n<head>\n<title>%s</title>\n</head>\n<body>\n%s\n</body>\n</html>""" % \
+ (feed_title + ": " + article_title, description)
+ mail = MIMEText(content)
mail['From'] = mfrom
mail['To'] = mto
- mail['Subject'] = '[pyAggr3g470r] News from ' + feed_title
+ mail['Subject'] = '[pyAggr3g470r] - ' + feed_title + ": " + article_title
#email['Text'] = message
server = smtplib.SMTP(smtp_server)
bgstack15