Sign In Start Free Trial
Account

Add to playlist

Create a Playlist

Modal Close icon
You need to login to use this feature.
  • Book Overview & Buying Python for Google App Engine
  • Table Of Contents Toc
  • Feedback & Rating feedback
Python for Google App Engine

Python for Google App Engine

By : Pippi
4.1 (10)
close
close
Python for Google App Engine

Python for Google App Engine

4.1 (10)
By: Pippi

Overview of this book

If you are a Python developer, whether you have experience in web applications development or not, and want to rapidly deploy a scalable backend service or a modern web application on Google App Engine, then this book is for you.
Table of Contents (10 chapters)
close
close
9
Index

Sending notification e-mails

It's very common for web applications to send notifications to the users, and e-mails are a cheap and effective channel for delivering. The Notes application could benefit from a notification system as well: early in this chapter, we modified the shrink image function so that it runs in a task queue. Users receive a response immediately, but the actual job is put in a queue and they don't know if and when shrink operations complete successfully.

As we can send e-mail messages from an App Engine application on behalf of the administrators or users with Google Accounts, we send a message to the user as soon as the shrink operation is completed.

We first import the mail package in the main.py module:

from google.appengine.api import mail

Then we append the following code to the end of the post() method in the ShrinkHandler class:

sender_address = "Notes Team <[email protected]>"
subject = "Shrink complete!"
body = "We shrunk...

Unlock full access

Continue reading for free

A Packt free trial gives you instant online access to our library of over 7000 practical eBooks and videos, constantly updated with the latest in tech

Create a Note

Modal Close icon
You need to login to use this feature.
notes
bookmark search playlist download font-size

Change the font size

margin-width

Change margin width

day-mode

Change background colour

Close icon Search
Country selected

Close icon Your notes and bookmarks

Delete Bookmark

Modal Close icon
Are you sure you want to delete it?
Cancel
Yes, Delete

Delete Note

Modal Close icon
Are you sure you want to delete it?
Cancel
Yes, Delete

Edit Note

Modal Close icon
Write a note (max 255 characters)
Cancel
Update Note

Confirmation

Modal Close icon
claim successful

Buy this book with your credits?

Modal Close icon
Are you sure you want to buy this book with one of your credits?
Close
YES, BUY