예제 #1
0
def send_files_deletion_email(user, files):
    with app.app_context():
        send_email('[Flaski] Files deletion warning',
                sender=app.config['MAIL_USERNAME'],
                recipients=[user.email],
                text_body=render_template('email/files_deletion.txt',
                                            user=user, files=files),
                html_body=render_template('email/files_deletion.html',
                                            user=user, files=files),\
               reply_to=app.config['MAIL_USERNAME'] )
예제 #2
0
def send_help_email(user, eapp, emsg, etime, session_file):
    with app.app_context():
        emsg_html = emsg.split("\n")
        send_email('[Flaski] help needed: %s ' %eapp,
                sender=app.config['MAIL_USERNAME'],
                recipients=app.config['ADMINS'],
                text_body=render_template('email/app_help.txt',
                                            user=user, eapp=eapp, emsg=emsg, etime=etime, session_file=session_file),
                html_body=render_template('email/app_help.html',
                                            user=user, eapp=eapp, emsg=emsg_html, etime=etime, session_file=session_file),\
                reply_to=user.email )
예제 #3
0
파일: email.py 프로젝트: susanna-are/flaski
def send_submission_email(user,submission_type,submission_file, attachment_path,open_type="rb",attachment_type="application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"):
    with app.app_context():
        send_email('[Flaski][Automation][{submission_type}] Files have been submited for analysis.'.format(submission_type=submission_type),
                sender=app.config['MAIL_USERNAME'],
                recipients=[user.email, '*****@*****.**' ], 
                text_body=render_template('email/submissions.txt',
                                            user=user, submission_type=submission_type, attachment_path=attachment_path),
                html_body=render_template('email/submissions.html',
                                            user=user, submission_type=submission_type, attachment_path=attachment_path),\
                reply_to='*****@*****.**',\
                attachment=submission_file ,
                attachment_path=attachment_path ,\
                open_type=open_type,\
                attachment_type=attachment_type)
예제 #4
0
def send_async_email(app, msg):
    with app.app_context():
        mail.send(msg)