aboutsummaryrefslogtreecommitdiff
path: root/reminder.py
blob: 5fd0025069a6c19e77a589dcda86dd73657168cb (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
import smtplib
from email.mime.text import MIMEText 
from email.utils import formatdate
import sys

import email_helper
from config import config

def send_reminder():
    """Sends a reminder email based on the arguments for easy scripting
    Usage: python3 reminder.py <subject> <body...>
    """

    name = config["email"]["name"]
    user = config["email"]["user"]
    subject = "REMINDER: %s" % sys.argv[1]
    body = sys.argv[2] if len(sys.argv) > 2 else ""
    email_helper.send(user, name, user, subject, body)

if __name__ == "__main__":
    send_reminder()