示例#1
0
def _send_reset_password_email(user):
    code = _generate_reset_password_code(user)
    body = render_template('user/reset_password_email.txt', code=code, user=user)

    msg = Message("Reset password", recipients=[user.email])
    msg.body = body

    mail.send(msg)
示例#2
0
def contact():
    form = ContactForm()

    if form.validate_on_submit():
        msg = Message("AnnotateIt.org contact form",
                      recipients=current_app.config['CONTACT_RECIPIENTS'])
        msg.body = render_template('contact_email.txt', **form.data)
        mail.send(msg)

        flash('Your message was sent successfully. Thanks!', 'success')
        return redirect(url_for('.index'))

    return render_template('contact.html', form=form)
示例#3
0
def contact():
    form = ContactForm()

    if form.validate_on_submit():
        msg = Message(
            "AnnotateIt.org contact form",
            recipients=current_app.config['CONTACT_RECIPIENTS']
        )
        msg.body = render_template('contact_email.txt', **form.data)
        mail.send(msg)

        flash('Your message was sent successfully. Thanks!', 'success')
        return redirect(url_for('.index'))

    return render_template('contact.html', form=form)