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)
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)
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)