Skip to content

Commit 27ebf5c

Browse files
committed
add email support
v2.1
1 parent fe0277d commit 27ebf5c

File tree

11 files changed

+14
-14
lines changed

11 files changed

+14
-14
lines changed

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ This is a simple flask register-form application designed to run in multiple way
55
* This app use _[MongoDB](https://www.mongodb.com/)_ as database supported by _[Flask-MongoAlchemy](https://pythonhosted.org/Flask-MongoAlchemy/)_ extension
66
=> So you have to install **MongoDB** database to run this locally
77

8-
* uses _[Flask-SocketIO](https://github.com/miguelgrinberg/Flask-SocketIO)_ along with _[Ajax](https://en.wikipedia.org/wiki/Ajax_(programming)_ for real time update
8+
* uses _[Flask-SocketIO](https://github.com/miguelgrinberg/Flask-SocketIO)_ along with _[Ajax](https://en.wikipedia.org/wiki/Ajax_(programming))_ for real time update
99

1010
* you will get an email if you have registered
1111

@@ -26,7 +26,7 @@ This app is designed to run in different ways:
2626
2. `git clone` the project then `cd` into the directory
2727
3. run `virtualenv -p /usr/bin/python3 venv`or `python -m venv venv` to create a virtual environment
2828
4. activate it using `source venv/bin/activate`
29-
5. `pip install -r requirements/prod_local.txt.txt` to install the app libaries and it dependencies
29+
5. `pip install -r requirements/prod_local.txt` to install the app libaries and it dependencies
3030
6. install MongoDB database `sudo apt-get install mongodb`
3131
7. check your database is installed and print its version using `mongo --version`
3232

app/mail.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,6 @@ def send_sync_email(app, msg):
1515
mail.send(msg)
1616

1717
def send_mail(user):
18-
send_email_helper('[Flask-Simple-Form] Notification', sender=app.config['MAIL_USERNAME'], \
18+
send_email_helper(' [flask-simple-form] ', sender=app.config['MAIL_USERNAME'], \
1919
recipients=[user.email], text_body = render_template('email/register_notification.txt', user=user),
2020
html_body = render_template('email/register_notification.html', user=user))

app/templates/base.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,13 @@
55
<meta charset="utf-8">
66
<meta http-equiv="X-UA-Compatible" content="IE=edge">
77
<meta name="viewport" content="width=device-width, initial-scale=1">
8-
<meta name="description" content="Flask Simple Form">
8+
<meta name="description" content="flask-simple-form">
99
<meta name="author" content="Ahmed Nouira">
1010
{% block refresh %}
1111
{% endblock %}
1212
<link rel="shortcut icon" href="{{url_for('static', filename='favicon.ico')}}" type="image/x-icon">
1313

14-
<title>Flask Simple Form </title>
14+
<title>flask-simple-form</title>
1515

1616
<!-- jQuery (necessary for Bootstrap's JavaScript plugins) -->
1717
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.12.4/jquery.min.js"></script>

app/templates/email/register_notification.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,11 @@
1616
<div style="text-align: center;">
1717
<h2> Dear {{ user.first_name }}, {{user.last_name}} </h2>
1818
<h2>
19-
Thanks for registering to <a style="color: #00aed1; text-decoration:none;" href="https://github.com/AhmNouira/flask-simple-form" target=_blank> Flask-Simple-Form </a></h2>
19+
Thanks for registering to <a style="color: #00aed1; text-decoration:none;" href="https://github.com/AhmNouira/flask-simple-form" target=_blank> flask-simple-form </a></h2>
2020

2121
<h2> See you later </h2>
2222

23-
<h2> ^^ The Blog Team ^^ </h2>
23+
<h2> ^^ flask-simple-form Team ^^ </h2>
2424
<br>
2525
<br>
2626
</div>
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
Dear {{user.first_name }}, {{ user.last_name}}
2-
Thank you for your registering to our Flask-Simple-Form
2+
Thank you for your registering to our flask-simple-form
33

44
Sincerely,
55

6-
^^ Flask-Simple-Form Team ^^
6+
^^ flask-simple-form Team ^^

app/templates/index.html

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
console.log(socket);
2727

2828
socket.on('my_response', function(msg) {
29-
$('#time').html (msg.time.day_name + ", " + msg.time.day + " " + msg.time.month + " " + msg.time.year + ", " + msg.time.hour + ":" + msg.time.minute + ":" + msg.time.second + " " + msg.time.pm_am + " <span class='blue'> Real-Time-Update </span>" );
29+
$('#time').html (msg.time.day_name + ", " + msg.time.day + " " + msg.time.month + " " + msg.time.year + ", " + msg.time.hour + ":" + msg.time.minute + ":" + msg.time.second + " " + msg.time.pm_am + " <span class='blue'> Real-Time </span>" );
3030
});
3131
});
3232

@@ -39,9 +39,9 @@
3939
<img class="newappIcon" src="../static/images/newapp-icon.png" alt="newapp"/>
4040
</div>
4141
<div class="col-sm-offset-1 col-sm-7">
42-
<h1 class="blue"> Flask Simple Form </h1>
42+
<h1 class="blue"> flask-simple-form </h1>
4343

44-
<h2 id="time"> {{time['day_name']}}, {{time['day']}} {{time['month']}} {{time['year'] }}, {{time['hour']}}:{{time['minute']}}:{{time['second']}} {{time['pm_am']}} <span class="blue">Real-Time-Update</span> </h2>
44+
<h2 id="time"> {{time['day_name']}}, {{time['day']}} {{time['month']}} {{time['year'] }}, {{time['hour']}}:{{time['minute']}}:{{time['second']}} {{time['pm_am']}} <span class="blue">Real-Time</span> </h2>
4545

4646
</div>
4747
</div>

app/templates/registered.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
<div class="col-sm-offset-1 col-sm-7">
2828
<h1>Thank You for Registering!</h1>
2929
<p style="padding-top: 20px;">You are now registered
30-
for <a href="https://github.com/AhmNouira/flask-simple-form" target="_blank" class="blue" style="font-weight: bold;"> Flask Simple Form App</a>.</p>
30+
for <a href="https://github.com/AhmNouira/flask-simple-form" target="_blank" class="blue" style="font-weight: bold;"> flask-simple-form</a>.</p>
3131

3232
<p> We look forward to seeing you.</p>
3333
<p> Today is

img/email.png

1.38 KB
Loading

img/index.png

2.63 KB
Loading

img/registered.png

-401 Bytes
Loading

0 commit comments

Comments
 (0)