For todays post I wanted to explore a use case for the SendGrid API, that I personally don’t see too often. That use case is mashing up a Machine Translation API with our mail API and webhook. I want to create an email address that lets me communicate with my coworkers and friends that I have been lucky to make in Brazil.

How this will work:

I’m going to create an application that will translate any email that I send out into portuguese. Any email that gets sent to that address will be translated back into english. The concept is pretty simple and our API makes this type of communication really easy.

Requirements

Lets Start

Just like we did in the last Code Challenge post with Orchestrate, I’m going to use our parse webhook and create a domain name for receiving incoming mail.

I’m going to use: brazil.bymail.in , this means any email sent to something@brazil.bymail.in will be sent to my Python application.

Here is the code:

This code is just for sample use. It will take any email it gets, translate it into Portuguese and email the translated content back to the sender. This is pretty simple, fun and powerful. I’ve posted some photos that showcase the translation:

 

Over the next few weeks, I’m going to continue writing about different technologies, so check back every Monday, Wednesday, and Friday for new tech posts! You can also visit my intro post that will have an updated list of everything I’ve written.



Meet Kunal, Developer Evangelist at-large for SendGrid and home-grown New Jersey hacker. He previously ran General Machines, which developed Deaftel - a phone service for the deaf that converts voice to text and text back into voice over a phone call. Since March 2013, Kunal has been working as a Developer Evangelist at SendGrid, helping enable developers to get the tools and resources they need to make awesome, creative stuff.