Пример #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)