How To: Implement Transactional Email in 1 Hour or Less
This post outlines how to quickly implement transactional email using the Sendwithus API.
As an example, we show how CodeCombat uses our API to keep their players and contributors updated and engaged with their service. Take a look below for a line by line guide on their implimentation.
But first, some background.
Earlier this year, the team open sourced the product, so that users could create their own content. Today, they have 155 contributors on Github, and over a 1000 people using their level editor to add to the game.
“Transactional emails are important to keep people engaged, both when playing on and contributing to CodeCombat. And, it took just about no time to set up the Sendwithus API.”
– Scott Erickson, Co-Founder CodeCombat
By implementing our API, CodeCombat is able to engage players with new challenges, and update contributors on changes to their documents.
They got setup and started sending email in under an hour – here’s how they did it.
STEP ONE: Install The Sendwithus API Client
Our open source clients can be found on the Sendwithus Development Page. API’s are available in Ruby, Python, Node.js, PHP, Java, and cURL.
STEP TWO: Retrieve The API Key
Create a free Sendwithus account and retrieve the ‘Production API Key’ from our ‘API Settings’ Tab.
STEP THREE: Implement The Code
Reference the Sendwithus Library and input the API Key
Create an API Call with references to the email templates you’ll be using. You can find the email template API ID’s under the ‘My Templates’ tab on the Sendwithus Dashboard.
Finally, setup a function that triggers an API call. In this case, CodeCombat sends an email if a change is made to a document a contributor is watching.