示例#1
0
def Email_Gdrive_Export(GdriveLink, user):
    """Emails user with exported data result"""

    message = Message(subject="SA - Data Export", sender='*****@*****.**', recipients=[user.email])
    message.html = render_template('/emails/html/export_data.html', username=user.username, GdriveLink=GdriveLink)
    message.body = f'''Good News everyone! You can access the scraped data here {GdriveLink}
    '''
    mail.send(message)
    return
示例#2
0
def Email_Account_Creation(user):
    message = Message(subject="SA - Account Creation",
                      sender='*****@*****.**',
                      recipients=[user.email])
    message.html = render_template('/emails/html/account_creation.html',
                                   username=user.username)
    message.body = f'''Thanks for signing up to SA. To verify your email click here:
{url_for('users.verify',  _external=True)}
'''
    #FINISH HTML TEMPLATES
    mail.send(message)
示例#3
0
def Email_Account_Verification(user):
    token = user.generate_token()
    message = Message(subject="SA - Account Verification",
                      sender='*****@*****.**',
                      recipients=[user.email])
    message.html = render_template('/emails/html/account_verify.html',
                                   username=user.username,
                                   token=token)
    message.body = f'''To verify your account, visit the following link:
{url_for('users.reset_confirm', token=token, _external=True)}
'''
    mail.send(message)
示例#4
0
def Email_Scraper_Success(GdriveLink, user):
    """
    Emails the user who requested data to be scraped with a Gdrive link
    """
    token = user.generate_token()
    message = Message(subject="SA - Data Scrape",
                      sender='*****@*****.**',
                      recipients=[user.email])
    message.html = render_template('/emails/html/scraped_result.html',
                                   username=user.username,
                                   GdriveLink=GdriveLink)
    message.body = f'''Good News everyone! You can access the scraped data here {GdriveLink}
    '''
    mail.send(message)
    return
示例#5
0
def Email_Password_Reset(user):
    token = user.generate_token()
    message = Message(subject="SA - Password Reset",
                      sender='*****@*****.**',
                      recipients=[user.email])
    message.html = render_template('/emails/html/password_reset.html',
                                   username=user.username,
                                   token=token)

    message.body = f'''To reset your password, visit the following link:
{url_for('users.reset_confirm', token=token, _external=True)}
If you did not make this request then simply ignore this email and no changes will be made.
'''
    #FINISH HTML TEMPLATES
    mail.send(message)