示例#1
0
def mail_request_rejected(id, email):
        msg = Message(
                app.config['MAIL_SUBJECT'],
                sender=app.config['MAIL_FROM'],
                recipients=[email]
                )
        msg.body = render_template('mail_request_rejected.txt')
        mail.send(msg)
def mail_certificate(id, email):
    msg = Message(app.config['MAIL_SUBJECT'],
                  sender=app.config['MAIL_FROM'],
                  recipients=[email])
    msg.body = render_template('mail.txt')
    certificate_path = "{}/freifunk_{}.tgz".format(
        app.config['DIRECTORY_CLIENTS'], id)
    with app.open_resource(certificate_path) as fp:
        msg.attach("freifunk_{}.tgz".format(id), "application/gzip", fp.read())
    mail.send(msg)
示例#3
0
def mail_certificate(id, email):
        workdir = tempfile.mkdtemp()
        cert_createTar(id, workdir)
        msg = Message(
                app.config['MAIL_SUBJECT'],
                sender=app.config['MAIL_FROM'],
                recipients=[email]
                )
        msg.body = render_template('mail.txt')
        certificate_path = "{}/freifunk_{}.tgz".format(workdir, id)
        with app.open_resource(certificate_path) as fp:
            msg.attach(
                    "freifunk_{}.tgz".format(id),
                    "application/gzip",
                    fp.read()
                    )
        mail.send(msg)
        rmtree(workdir)
def mail_certificate(id, email):
#    with app.app_context():
        msg = Message(
                app.config['MAIL_SUBJECT'],
                sender=app.config['MAIL_FROM'],
                recipients=[email]
                )
        msg.body = render_template('mail.txt')
        certificate_path = "{}/freifunk_{}.tgz".format(
                app.config['DIRECTORY_CLIENTS'],
                id
                )
        with app.open_resource(certificate_path) as fp:
            msg.attach(
                    "freifunk_{}.tgz".format(id),
                    "application/gzip",
                    fp.read()
                    )
        mail.send(msg)
def mail_info_after_request(email):
    msg = Message("Deine Anfrage für das Freifunk VPN ist eingegangen!",
                  sender=app.config['MAIL_FROM'],
                  recipients=[email])
    msg.body = render_template('mail_info_after_request.txt')
    mail.send(msg)
def mail_info_after_request(email):
    msg = Message(
        "Deine Anfrage für das Freifunk VPN ist eingegangen!", sender=app.config["MAIL_FROM"], recipients=[email]
    )
    msg.body = render_template("mail_info_after_request.txt")
    mail.send(msg)