コード例 #1
0
ファイル: mail.py プロジェクト: axelzcramer/thoughtloungev2
def send_error_mail():
    message = Message("Thought Lounge: Internal Server Error 500", recipients = app.config['ADMIN_EMAILS'])

    try:
        error_log = subprocess.call(['./.err.sh'])
        message.body = render_template('error.mail', error_log = error_log)
    except FileNotFoundError:
        message.body = render_template('error.mail', error_log = 'No error log available.')

    mail.send(message)
コード例 #2
0
ファイル: mail.py プロジェクト: axelzcramer/thoughtloungev2
def reminder():
    now = datetime.datetime.now()
    lounges = Lounge.query.filter(Lounge.date_time > now).all()

    for lounge in lounges:
        interval = lounge.date_time - now
        if interval < datetime.timedelta(days = 4):
            message = Message("Reminder to remind your loungers: lounge on {0}".format(lounge.formatted_local_date_time), recipients = [lounge.host.email])
            message.body = render_template('remind_host.mail', lounge = lounge)
            mail.send(message)
コード例 #3
0
def send_error_mail():
    message = Message("Thought Lounge: Internal Server Error 500",
                      recipients=app.config['ADMIN_EMAILS'])

    try:
        error_log = subprocess.call(['./.err.sh'])
        message.body = render_template('error.mail', error_log=error_log)
    except FileNotFoundError:
        message.body = render_template('error.mail',
                                       error_log='No error log available.')

    mail.send(message)
コード例 #4
0
def reminder():
    now = datetime.datetime.now()
    lounges = Lounge.query.filter(Lounge.date_time > now).all()

    for lounge in lounges:
        interval = lounge.date_time - now
        if interval < datetime.timedelta(days=4):
            message = Message(
                "Reminder to remind your loungers: lounge on {0}".format(
                    lounge.formatted_local_date_time),
                recipients=[lounge.host.email])
            message.body = render_template('remind_host.mail', lounge=lounge)
            mail.send(message)
コード例 #5
0
def send_welcome_mail(user):
    lounges = Lounge.query.filter(Lounge.date_time > now).all()
    message = Message("Welcome to Thought Lounge!", recipients=[user.email])
    message.body = render_template('welcome.mail', user=user)
    if not app.config['TESTING']:
        mail.send(message)
コード例 #6
0
ファイル: mail.py プロジェクト: axelzcramer/thoughtloungev2
def send_welcome_mail(user):
    lounges = Lounge.query.filter(Lounge.date_time > now).all()
    message = Message("Welcome to Thought Lounge!", recipients = [user.email])
    message.body = render_template('welcome.mail', user = user)
    if not app.config['TESTING']:
        mail.send(message)