from flask import url_for
from mast import mail
from flask_mail import Message


def send_reset_email(user):
    token = user.get_reset_token()
    msg = Message('Password Reset Request',
                  sender='<EMAIL>',
                  recipients=[user.email])

    msg.body = f'''To reset your password, visit the following link:
    {url_for('users.reset_token', token=token, _external=True)}

    If you did not make this request then simply ignore this email. No changes required here.
    '''
    mail.send(msg)

def send_registration_email(user):
    msg = Message('Welcome to Mathletics',
                  sender='<EMAIL>',
                  recipients=[user.email])

    msg.body = f'''Hi, 
        welcome to Mathletics.
        
        You can now participate in our current competitions. 

        Good luck,
        Matfyz Developer Student Club



        If you did not register, please contact us at <EMAIL>.

        '''
    mail.send(msg)

from flask import url_for
from mast import mail
from flask_mail import Message


def send_reset_email(user):
    token = user.get_reset_token()
    msg = Message('Password Reset Request',
                  sender='<EMAIL>',
                  recipients=[user.email])

    msg.body = f'''To reset your password, visit the following link:
    {url_for('users.reset_token', token=token, _external=True)}

    If you did not make this request then simply ignore this email. No changes required here.
    '''
    mail.send(msg)

def send_registration_email(user):
    msg = Message('Welcome to Mathletics',
                  sender='<EMAIL>',
                  recipients=[user.email])

    msg.body = f'''Hi, 
        welcome to Mathletics.
        
        You can now participate in our current competitions. 

        Good luck,
        Matfyz Developer Student Club



        If you did not register, please contact us at <EMAIL>.

        '''
    mail.send(msg)

To reset your password, visit the following link:     {url_for('users.reset_token', token=token, _external=True)}      If you did not make this request then simply ignore this email. No changes required here. Hi,          welcome to Mathletics.                  You can now participate in our current competitions.           Good luck,         Matfyz Developer Student Club            If you did not register, please contact us at <EMAIL>.