APIs provide “hooks” for developers to create new applications on top of other services. Many of these same hooks have been converted into templates that give anyone access to functionality previously only available to programmers. With services like If This Then That and Zapier, anyone can automate their business or their lives with what I call “un-programming.” This post is a taste of a SXSW workshop I’ll be giving on Tuesday.
Unlike with normal programming, where you could integrate with any API, un-programming requires a little more work to be completed for you. You need to have a template available within one of the un-programming tools:
Though the terminology between these two companies is different, the approach is very similar. When something happens within one supported service, you can automatically react and include specific details in a request to another service. You can start with someone else’s connection between two services, or you can create your own.
Send an Email and Track Clicks
Though IFTTT sends its email through SendGrid (using the company’s own account), this example will use Zapier’s SendGrid integration, because it allows you to send email through your own account, which you can then track via your dashboard or our Event Webhook.
Let’s trigger an email. There are many ways to do this, but let’s give us some interesting data to use. We’ll create a Google Spreadsheet form by clicking Create and choosing Form from the menu.
Since we’ll be sending an email to everyone who fills out our survey, we’d better collect the email address. The other information you put on the form is up to you. I created a multiple choice question about favorite fruits. Who doesn’t love fruit?
Whenever a form is filled out, the answers become a new row in Google Spreadsheets. Therefore, we’ll use Zapier to create a new email sent through SendGrid whenever there is a new row in the spreadsheet.
Next, Zapier will have you authenticate your Google and SendGrid accounts, then identify the Google Spreadsheet that is attached to the form you just created. Step 5 is the fun one, because that’s where you declare how your action will be performed. You are sending an email to the address included in the form, so you can click the “insert fields” button to find your email address field.
For the message body that I send, I wanted to make sure I used what I know about the recipient. I know their favorite fruit, so I have included a link to Google Image Search results. Who doesn’t love pictures of their favorite fruit? Also, since Zapier includes a prominent unsubscribe link, we don’t need to worry about it ourselves.
Once you have connected the dots, Zapier has a great way to test your integration before it goes live. Since you may only be checking for new results every 15 minutes, the Test This Zap section can ensure it’s working without you having to wait a long time as you debug anything you may have missed.
Be sure to visit your SendGrid apps page in your SendGrid account and enable click tracking. With that app activated, you can get more information on the links clicked within your email.
While you’re on the apps page, consider also enabling the Event Notification app, which allows you to point our Event Webhook at any endpoint. For example, you could use it in conjunction with the Zapier Webhook app to react to clicks, opens, unsubscribes or any of the nine email events for which SendGrid provides data.