Esempio n. 1
0
def email_appkey(prj_id, member_email):
    memkey = ProjectMemberKey.find_one(prj_id=prj_id, member_email=member_email)
    if settings.MAIL_SERVER:
        mail = Mail(current_app._get_current_object())
        message = Message("Your new appkey for 4k mobile app",
            sender='*****@*****.**',
            recipients=[member_email])
        message.body = ( 'Project ID: %s \nAppkey: %s' % 
            (prj_id, memkey.appkey) )
        mail.send(message)
        flash("New appkey has been send to your email.", category='info')
    else:
        flash("Can not email because email server is not availalbe. " +  
            "Contact administrator", category='error')
            
    return redirect(url_for('.view_project', prj_id=prj_id))  
Esempio n. 2
0
def email_appkey(prj_id, member_email):
    debug_set = current_app.config["DEBUG"]
    if debug_set == True:
        print "\n\n\n==========> account->views.py -> email_appkey() "
    memkey = ProjectMemberKey.find_one(prj_id=prj_id, member_email=member_email)
    if settings.MAIL_SERVER:
        mail = Mail(current_app._get_current_object())
        message = Message(
            "Your new appkey for 4k mobile app", sender="*****@*****.**", recipients=[member_email]
        )
        message.body = "Project ID: %s \nAppkey: %s" % (prj_id, memkey.appkey)
        mail.send(message)
        flash("New appkey has been send to your email.", category="info")
    else:
        flash("Can not email because email server is not availalbe. " + "Contact administrator", category="error")

    return redirect(url_for(".view_project", prj_id=prj_id))