def email(): user = UserManager() values = user.getModelFromForm(request.form) message = values.object.descr print(message) recipient = values.object.nickname print(recipient) msg = Message(message, sender="*****@*****.**", recipients=[recipient]) mail.send(msg) return('ok')
def edit(): nickname = session['username'] context = {} user = UserManager() if user.SelectUser(nickname): context['user'] = user if request.method == 'POST': user = user.getModelFromForm(request.form) if user.save(): context['user'] = user return redirect(url_for('home')) return render_template('edit.html', context=context)
def email(): print('Hello Sender!') if request.method == 'POST': user = UserManager() values = user.getModelFromForm(request.form) message = values.object.descr #recipient = values.object.nickname #print(recipient) msg = Message(message, sender="*****@*****.**", recipients=["*****@*****.**"]) mail.send(msg) return ('ok')