Esempio n. 1
0
def register():
    title = "Virtual Tour Mates | REGISTER"
    form = UserInfoForm()
    if request.method == 'POST' and form.validate():
        username = form.username.data
        email = form.email.data
        password = form.password.data
        # print(username, email, password)
        
        # create a new instance of User
        new_user = User(username, email, password)
        # add new instance to our database
        db.session.add(new_user)
        # commit database
        db.session.commit()

        # Send email to new user
        msg = Message(f'Welcome, {username}', [email])
        msg.body = "Thank you for signing up for the Virtual Tour Mates. I hope you enjoy our app!"
        msg.html = "<p>Thank you so much for signing up for the Virtual Tour Mates. I hope you enjoy our app!</p>"

        mail.send(msg)

        flash("You have succesfully signed up!", "success")
        return redirect(url_for('index'))
    return render_template('register.html', title=title, form=form)
Esempio n. 2
0
def register():
    title = ddb + "register"
    form = UserInfoForm()
    if request.method == 'POST' and form.validate():
        username = form.username.data
        email = form.email.data
        password = form.password.data
        phone = form.phone.data
        address = form.address.data
        city = form.city.data
        zipcode = form.zipcode.data
        # admin = form.admin.data
        # print(username, email, password)

        # create new instance of User
        new_user = User(username, email, password,phone, address, city, zipcode)
        # add new instance to our database
        db.session.add(new_user)
        # commit database
        db.session.commit()

        # send email to new user
        msg = Message(f"Welcome, {username}", [email])
        msg.body = 'Thank you for signing up for the most glorious death of your bugs. I hope you enjoy your new carnage!'
        msg.html = "<p>Thanks you so much for signing up for the Dale's Dead Bugs service. Where we do buggin right! We may, or may not, be in Liberia!</p>"

        mail.send(msg) 

        flash("It may be a crack in your internet, or the Chinese are making their move!", "success")
        return redirect(url_for('index'))
    return render_template('register.html', title=title, form=form)
Esempio n. 3
0
def register():
    title = 'Kekembas Blog | REGISTER'
    form = UserInfoForm()
    if request.method == 'POST' and form.validate():
        username = form.username.data
        email = form.email.data
        password = form.password.data
        print(username, email, password)

        #create a new instance of user
        new_user = User(username, email, password)
        #add new instance to database
        db.session.add(new_user)
        #commit database
        db.session.commit()

        #send email to new user
        msg = Message(f'Welcome, {username}', [email])
        msg.body = 'Thank you for signing up to the Kekembas Blog, I hope you enjoy our app!'
        msg.html = '<p> Thank you so much for signing up for the Kekembas blog . I hopt you enjoy our app!</p>'

        mail.send(msg)

        flash("You have succesfully sign up!", "success")
        return redirect(url_for('hello_world'))

    return render_template('register.html', title=title, form=form)
Esempio n. 4
0
def RegisterPhoneNum():
    title = 'Register Phone Number'
    regPhone = RegisterPhoneForm()
    if request.method == 'POST' and regPhone.validate:
        username = regPhone.username.data
        firstName = regPhone.firstName.data
        lastName = regPhone.lastName.data
        phoneNum = regPhone.phoneNum.data
        email = regPhone.email.data
        address = regPhone.address.data
        city = regPhone.city.data
        state = regPhone.state.data
        password = regPhone.password.data

        print(username, firstName)

        new_user = User(username, firstName, lastName, phoneNum, email,
                        address, city, state, password)
        db.session.add(new_user)
        db.session.commit()

        msg = Message(f"Welcome, {username}", [email])
        msg.html = "<p>You have now signed up for a useless phonebook! Enjoy the junk mail we will be sending you!!!!</p>"
        mail.send(msg)

        flash("You have successfully signed up!", "success")
        return redirect(url_for('index'))

    return render_template('registerPhone.html',
                           title=title,
                           regPhone=regPhone)
Esempio n. 5
0
def register():
    title = 'Kekembas blog | REGISTER'
    form = UserInfoForm()
    

    if request.method == 'POST' and form.validate():
        username = form.username.data
        email = form.email.data
        password = form.password.data

        print(username,email, password)
        
        #create a new instance of User
        new_user = User(username,email,password)
        #add new instance of use
        db.session.add(new_user)
        #commit database
        db.session.commit()

        #SEND EMAIL TO NEW USER
        msg = Message(f"welcome, {username}", [email])
        msg.body = 'Thank you for siging up for the kekembas blog. I hope you enjoy our blog!'
        msg.html = '<p>Thank you so much for signing up for out blog!</p>'
        
        mail.send(msg)

        flash("You have succesfully signed up!", "success")
        return redirect(url_for('index'))

    return render_template('register.html', title=title,form=form)
Esempio n. 6
0
def register():
    title = 'Kekambas Blog | REGISTER'
    form = UserInfoForm()
    if request.method == 'POST' and form.validate():
        username= form.username.data
        email= form.email.data
        password= form.password.data
        # print(username, email, password)
        # create a new instance of User
        new_user= User(username, email, password)
        # add new instance of our database
        db.session.add(new_user)
        # commit database
        db.session.commit()
        # Send email to new user
        msg= Message(f'Welcome, {username}', [email])
        msg.body = 'Thank you for signing up for the Kekembas blog. I hope you enjoy our app!'
        msg.html = '<p> Thank you so much for signing up for the Kekemnbas blog. I hope you enjoy our app </p>'
        # send email

        mail.send(msg)

        flash('Welcome aboard!', 'success')
        return redirect(url_for("hello_world"))
    return render_template('register.html', title = title, form=form)
Esempio n. 7
0
def register():
    form = UserInfoForm()
    context = {'form': form}
    if request.method == 'POST' and form.validate():

        # Get Information
        username = form.username.data
        email = form.email.data
        password = form.password.data

        print(username, email, password)

        # Create new instance of User
        new_user = User(username, email, password)

        # Add user to db
        db.session.add(new_user)
        db.session.commit()

        # flash success message
        flash("You have successfully registered", 'success')

        # Flask Email Sender
        msg = Message(f'Thanks for signing up, {username}!',
                      recipients=[email])
        msg.body = ('Congrats on signing up! I hope you enjoy our site!!')
        msg.html = ('<h1>Welcome to Our Site</h1>'
                    '<p>This will be super cool!</p>')

        mail.send(msg)

        return redirect(url_for('index'))
    return render_template('register.html', **context)
Esempio n. 8
0
 def send_mail_with_order_details(details):
     msg = Message(
         'From Books Store',
         sender=mail_user,
         recipients=[details[0]]
     )
     msg.html = render_template('email.html', details=details)
     mail.send(msg)
Esempio n. 9
0
 def __init__(self, email):
     try:
         msg = Message(f"Регистрация на сайте  {adpess_site}",
                       recipients=[f'{email}'])
         msg.html = f"<h2>Подтреждение о регистрации на сайте</h2>"
         mail.send(msg)
     except:
         pass
Esempio n. 10
0
 def __init__(self, form):
     try:
         msg = Message("Пароль от аккаунта", recipients=[f'{form.address.data}'])
         msg.html = f"<h2>Для изменения пароля на сайте {adpess_site}\n" \
                    f"передите по ссылке и введите новый пароль \n" \
                    f"<a href='{adpess_site}/update_password/{form.address.data}'>Изменить пароль" \
                    f"</a></h2>\n<p></p>"
         mail.send(msg)
     except :
         pass
Esempio n. 11
0
def register():
    title = "Phonebook | REGISTER"
    form = UserInfoForm()
    if request.method == "POST" and form.validate():
        username= form.username.data
        password= form.password.data
        email = form.email.data
        phone= form.phone.data

        new_user=User(username, email, phone, password)
        db.session.add(new_user)
        db.session.commit()

        welcome = Message(f'Welcome, {username}', [email])
        welcome.html = '<p>Thank you for signing up! Your phone is now in our phonebook</p>'
        mail.send(welcome)
        flash ("You have added your entry", "success")
        return redirect(url_for("index"))
    return render_template('registerphone.html', title= title, form=form)