コード例 #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)
コード例 #2
0
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)
コード例 #4
0
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)
コード例 #5
0
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)
コード例 #6
0
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)