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.


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: , this means any email sent to 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.

SendGrid Team
Expert advice and insight about all things email including best practices tips, examples, and advice for marketers, developers, and everyone in between.