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