This post outlines how to quickly implement transactional email using the Sendwithus API.
As an example, we’ll show you how CodeCombat uses our API to keep players and contributors up-to-date and engaged with their service.
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 were set up and 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 IDs under the ‘My Templates’ tab on the Sendwithus Dashboard.
Finally, set up 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.