From 3f2e142d2c9b1e46faee988111abaffea946ce6a Mon Sep 17 00:00:00 2001 From: Mark Powers Date: Sun, 20 Sep 2020 02:09:44 +0000 Subject: Add imap to email_helper, add reminders in daily-update --- daily-update.py | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) (limited to 'daily-update.py') diff --git a/daily-update.py b/daily-update.py index 7109b99..aa30efe 100755 --- a/daily-update.py +++ b/daily-update.py @@ -33,9 +33,21 @@ def get_old_news(): news_text += '%s %s\n' % (full, name, century_ago) return news_text +def get_unread_reminders(): + print("getting unread reminders") + subjects = email_helper.filter_unread("subject", "REMINDER:", "subject") + subjects = [s[len("REMINDER: "):].strip() for s in subjects] + if len(subjects) > 0: + reminder_html = "

Reminders:

\n" + return reminder_html + return "" + def format_email(): print("forming email") - return '%s%s' % (get_old_news(), get_weather()) + return '%s%s%s' % (get_unread_reminders(), get_old_news(), get_weather()) def send_update_email(): frm = config["email"]["user"] -- cgit v1.2.3