diff --git a/goathacks/__init__.py b/goathacks/__init__.py index 6530201..9539750 100644 --- a/goathacks/__init__.py +++ b/goathacks/__init__.py @@ -1,4 +1,4 @@ -from flask import Flask, redirect, render_template, send_from_directory, url_for +from flask import Flask, redirect, render_template, send_from_directory from flask_sqlalchemy import SQLAlchemy from flask_migrate import Migrate from flask_login import LoginManager @@ -44,24 +44,6 @@ def create_app(): from goathacks import cli app.cli.add_command(cli.gr) - - #Sponsor page - @app.route("/sponsor") - def sponsorindex(): - return render_template('home/sponsor/index.html') - - @app.route('/sponsor/') - def sponsor(path): - return send_from_directory('templates/home/sponsor', path) - - #Code of conduct - @app.route('/conduct') - def conductindex(): - return render_template('home/conduct/index.html') - @app.route('/conduct/') - def conduct(path): - return send_from_directory('templates/home/conduct', path) - # Homepage @app.route("/") def index_redirect(): diff --git a/goathacks/registration/__init__.py b/goathacks/registration/__init__.py index 0a0e839..671cdd3 100644 --- a/goathacks/registration/__init__.py +++ b/goathacks/registration/__init__.py @@ -4,8 +4,9 @@ import flask_login from flask_login import current_user from goathacks.registration.forms import LoginForm, RegisterForm from werkzeug.security import check_password_hash, generate_password_hash +from flask_mail import Message -from goathacks import db +from goathacks import db, mail as app_mail from goathacks.models import User bp = Blueprint('registration', __name__, url_prefix="/registration") @@ -55,6 +56,16 @@ def register(): db.session.commit() flask_login.login_user(user) + if waitlisted: + msg = Message("Goathacks - Waitlist Confirmation") + else: + msg = Message("GoatHacks - Registration Confirmation") + + msg.add_recipient(user.email) + msg.sender = ("GoatHacks Team", "hack@wpi.edu") + msg.body = render_template("emails/registration.txt", user=user) + app_mail.send(msg) + return redirect(url_for("dashboard.home")) else: flash("Passwords do not match") diff --git a/goathacks/templates/emails/registration.txt b/goathacks/templates/emails/registration.txt index e686e80..81a802f 100644 --- a/goathacks/templates/emails/registration.txt +++ b/goathacks/templates/emails/registration.txt @@ -3,7 +3,7 @@ Dear {{ user.first_name }}, Your application for GoatHacks has been confirmed! {% if user.waitlisted %}You're on the waitlist right now, but we'll send you another email if a spot opens up.{% else %}You've got a confirmed spot this year! Make sure to look at -the schedule at https://hack.wpi.edu.{% endif %} +the schedule at https://hack.wpi.edu. {% if not user.waitlisted %} We'll send another email with more details closer to the event. In the diff --git a/goathacks/templates/header.html b/goathacks/templates/header.html index 845cfb8..bc6489a 100644 --- a/goathacks/templates/header.html +++ b/goathacks/templates/header.html @@ -22,7 +22,7 @@