The following is a guest post by Wataru Sato, a developer who works with SendGrid in Japan. He has a blog at http://awwa500.blogspot.jp/ and you can find his GitHub page here: https://github.com/awwa.
Today, I created a game using SendGrid. It’s called SendGrid-Reversi, and it let’s you play Reversi entirely over email!
It runs on Sinatra, the data is stored in MongoDB, and the functionality is built on top of the various SendGrid APIs.
Launch the Application
Clone the repo, and follow the instructions. On launch, the application begins configuring itself automatically by:
- Creating templates and versions via Template Engine.
- Configuring some of Apps via Web API.
- Configuring the Parse Webhook.
- Configuring and enabling Event Notifications.
- Enabling Click Tracking.
Start Reversi With an Email
You start a game by sending an email to the application with the subject set to a friend’s email address. Using SendGrid’s Parse Webhook, the application receives the email, parses the friend’s email address from the subject, and begins the game.
The App Sends Emails to Each Player
Click to Play – In the Email!
The player then clicks in the email where they want to place a disc on a cell. It’s that easy! This click event is POSTed to the application from SendGrid. The application processes the event, and sends emails to each player again.
In this way, you can play Reversi entirely over email. Amazing, yes.
This is just a simple demo application, but these same API elements could be applied in your own application. Have fun, and come visit beautiful Japan!