Ejemplo n.º 1
0
Archivo: app.py Proyecto: T-G-P/Misc
def submit():
    to_emails = request.form['to_email']
    from_email = request.form['from_email']
    subject = request.form['subject']
    msg = request.form['msg']
    send_emails(to_emails, from_email, subject, msg)
    return render_template('result.html')
Ejemplo n.º 2
0
def send_mass_mail(name=None):
    if request.method == 'POST':
        users = get_users()
        u = get_user_by_name(name)
        message = request.form['message']
        subject = request.form['subject']

        send_emails(message, subject, users)
        #for user in users:
        #    message_parsed = parse_email(message, user, 3) # change ammount of depts here
        #    subject_parsed = parse_email(subject, user, 3) # change ammount of depts here!
        #    send_email(user.email, subject_parsed, message_parsed)

        success = "An alle User werden Rechnungen versendet."
        return render_template('billing.html', users=users, success=success, dept=0, user=get_user_by_name(session.get('name')))

    if request.method == 'GET':
        return render_template('billing_mass_mail.html', user=get_user_by_name(session.get('name')), emailtext=settings.masMessageStandardText, emailsubject=settings.masMessageStandardSubject)