You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardexpand all lines: twilio_sendgrid.md
+6-6
Original file line number
Diff line number
Diff line change
@@ -1,15 +1,15 @@
1
-
# How to Send and Receive Emails from You Flask App using Twilio SendGrid
1
+
# How to Send and Receive Emails from Your Flask App using Twilio SendGrid
2
2
3
3
[SendGrid](http://sendgrid.com/) is a communication platform for transactional and marketing email. The goal of using SendGrid is technically delivering an exceptional email experience since email is the backbone of a business' customer engagement. In this tutorial, I will show you how you can build a Flask application and integrate Twilio SendGrid APIs.
4
4
5
-
###What we will do:
5
+
## What we will do:
6
6
7
7
1. Create a SendGrid account
8
8
2. Build a Flask application
9
9
3. Integrate Flask mail
10
10
4. Integrate Twilio SendGrid
11
11
12
-
###Create a SendGrid account
12
+
## Create a SendGrid account
13
13
14
14
* Create a [free account](https://signup.sendgrid.com/) now
15
15
* Log into your account
@@ -24,7 +24,7 @@
24
24
25
25
Copy the API Key and save it somewhere safe. You will need it later.
26
26
27
-
###Build a Flask Application
27
+
## Build a Flask Application
28
28
29
29

30
30
@@ -105,7 +105,7 @@ Noteworthy, the files in `app/templates/email` carry the message that will be se
105
105
106
106
Also, it should be noted the application does send errors to the admin of the application whenever there is an internal server error. This email bears the message of the error so the admin can see the actual cause problem.
107
107
108
-
###Testing How to Send Password Reset Email Locally
108
+
## Testing How to Send Password Reset Email Locally
@@ -123,7 +123,7 @@ Also, it should be noted the application does send errors to the admin of the ap
123
123
124
124
You should be able to log in. From your terminal, you should have seen how the email authentication works.
125
125
126
-
###Sending Emails Using Twilio SendGrid
126
+
## Sending Emails Using Twilio SendGrid
127
127
128
128
Now that you know how to send emails using Flask Mail, you can do the same for applications that are on production. If you host this application, say in Heroku, you will note that the password reset feature does not work. You have no errors, but still it does not work. This is because the email service we are using does not work on production. And that is where Twilio SendGrid comes it.
Copy file name to clipboardexpand all lines: web_development/personal_blog/2_flask_templates.md
+2-2
Original file line number
Diff line number
Diff line change
@@ -6,7 +6,7 @@ In the previous chapter, you learnt how to display a string on the web browser.
6
6
7
7
Our application structure from [chapter 1](hello_world.md) was necessary to help us separate the application layout/presentation from the logic. Templates help us achieve this kind of separation. Flask templates are found in the _templates_ subfolder within the application instance.
8
8
9
-
###Working with Templates
9
+
## Working with Templates
10
10
11
11
Below, I am going to create a template for the home page of our blog.
12
12
@@ -69,7 +69,7 @@ app/templates/home.html: Conditional statemenst in template
69
69
```
70
70
The template is slightly smarter now to know when a title has been provided or not. If there is a title in the view function, then it will use it within it's head, otherwise, it will resort to displaying _Welcome to My Personal Blog_.
71
71
72
-
###Template Inheritance
72
+
## Template Inheritance
73
73
74
74
At this stage of the application, it is very easy to make edits in the templates. However, when the application becomes bigger and bigger, say, to have several templates, then making these edits on each template can become difficult and tiring. Thankfully, Flask allows for template inheritence where we can define a base layout for the entire blog. From this base layout, every other template that we will create will inherit the base styles and features. This makes is easy whenever we want to make changes to our growing application. The second reason to consider template inheritence is so that we can maintain a consistene theme or layout throughout our blog. We want that certain features be present in each template. For example, we would want to maintain our navigation bar and our footer everywhere.
0 commit comments