I am an iOS developer wading into pretty unfamiliar territory. I have a client who wants to utilize the body of an email, the content of which is dynamic items (like name, address, GPS coordinates) and utilize that information as part of a push notification.
Essentially I need to figure out a way how to get the body of the email, parse the contents for these common items, take those items and make a POST request to initiate a push notification to my app (likely using the REST API from Parse).
Some options i’ve considered. Writing a server-side app which monitors for new emails, parses the body and generates the code and makes the POST request (but im not sure exactly how).
Using Google’s App Engine and creating a script of some sort and using gmail (not sure exactly how to do that).
Im hoping someone out there has some ideas about how to accomplish this in a somewhat streamlined and elegant fashion. Input is appreciated.
You can look at the
MailServicein Google AppEngine to help you address your requirements. Here is the documentation.The service provides an ability to receive email that is sent to your application. Refer to the link here for Java: https://developers.google.com/appengine/docs/java/mail/receiving. If you are using Python, you can get the same from the Python Docs. The incoming mail service will allow you to write a simple handler/servlet that can get invoked every time you receive an email. You can parse out the email content and create your Push Notification data.
Alternately, instead of doing everything synchronously – you could break it up by:
1) Receive the email and create a Task
2) The Task sends off the Push Notification
Hope this helps.