Skip to Main Content
Python Programming Blueprints
book

Python Programming Blueprints

by Daniel Furtado, Marcus Pennington
February 2018
Intermediate to advanced content levelIntermediate to advanced
456 pages
9h 56m
English
Packt Publishing
Content preview from Python Programming Blueprints

Implementing the notification service

Now that we have everything set up, and the files that we are going to use as a template to send emails to the customers of the online (video) game store are in place in the python-blueprints S3 bucket, it is time to start implementing the notification service.

Let's go ahead and create a file called app.py in the notifier directory, and to start with, let's add some imports:

import smtplibfrom http import HTTPStatusfrom smtplib import SMTPAuthenticationError, SMTPRecipientsRefusedfrom email.mime.text import MIMETextfrom email.mime.multipart import MIMEMultipartimport boto3from botocore.exceptions import ClientErrorfrom flask import Flaskfrom flask import request, Responsefrom jinja2 import Template
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Intelligent Projects Using Python

Intelligent Projects Using Python

Santanu Pattanayak, Manohar Swamynathan
Flask Blueprints

Flask Blueprints

Joël Perras
Matplotlib for Python Developers - Second Edition

Matplotlib for Python Developers - Second Edition

Aldrin Yim, Claire Chung, Allen Yu

Publisher Resources

ISBN: 9781786468161Supplemental Content