Book Image

Mastering Google App Engine

By : Mohsin Hijazee, Mohsin Shafique
Book Image

Mastering Google App Engine

By: Mohsin Hijazee, Mohsin Shafique

Overview of this book

Table of Contents (18 chapters)
Mastering Google App Engine
Credits
About the Author
Acknowledgments
About the Reviewers
www.PacktPub.com
Preface
Index

Putting it all together


Now that we are done exploring everything about e-mails on Google App Engine, it is time to put it all together. We are going to develop an app that is similar to what we did in the last chapter. You give it a URL and an e-mail address. The page is downloaded, compressed, and stored in the datastore like before. But besides that, we also e-mail that page to the given e-mail address. In case the sending of the e-mail fails, we handle the bounce notifications and record this information in logs.

In case the user replies to the e-mail, we parse the incoming e-mails and record the feedback as well. Let's go through everything file by file. The first one is app.yaml:

application: your-app-id
version: 1 
runtime: python27 
api_version: 1 
threadsafe: true 

inbound_services: 
- mail 
- mail_bounce 

handlers: 
# Emails 
- url: /_ah/mail/.+ 
  script: email_handler.app 
  login: admin 
# Bounce backs 
- url: /_ah/bounce 
  script: email_handler.app 
  login: admin 
# Normal...