Zapier: Sending Coffee To Advocates via CoffeeSender
In this article, we will create an "integration" with AdvocateHub and CoffeeSender. The Goal? When an advocate completes a challenge, she will be sent an email containing a $5 coffee card.
Prerequisites
- A Zapier account
- A CoffeeSender account.
- A CoffeeSender API Partner Key (contact CoffeeSender if you need one)
- A CoffeeSender User Key (contact CoffeeSender if you need one)
- The ID of the CoffeeSender template you wish to use (learn how to get it here, or contact CoffeeSender for help)
Part I: Creating the challenge
In this section, we will create a generic challenge. You can configure it however you want. The only requirement is that the advocate must complete a stage of the challenge to receive the coffee. In this example, we'll use the Advocate Workflow stage to trigger the coffee card email. If you use a different stage, your webhook configuration will have to indicate the type of stage used in place of Advocate Workflow.
1. Go to the Challenges page and click Add a Challenge.
2. Click on the Blank Challenge button
3. Click on + Add Stage and add an "Advocate Workflow" stage
4. Configure your stage and the rest of your challenge, then save and publish.
Suggestions:
- If you want to indicate to the advocate which email the coffee will be sent to, use the merge field {{contact.email}}.
- For testing, target the challenge to a single test advocate.
Part II: Configuring the webhook and creating the Zap
2. For the Trigger, choose "Webhooks by Zapier > Catch Hook"
3. In the next step you will receive a URL. Copy this URL and open your AdvocateHub in a new tab.
4. Go to Settings > System > Webhooks and click Add a Webhook
5. Configure your Webhook:
- Webhook Name: Choose a memorable name, such as "CoffeeSender integration"
- Webhook Provider URL: Use the URL you copied from Zapier
- Format: Form Post
- Run webhook on these events: Advocate Workflow
At this point, return to your Hub and switch to Advocate View, then complete the Advocate Workflow stage once. Return to your Zapier tab and you should see that the test was successful after about 30 seconds.
9. Click on the + icon and add a Filter. Configure it like so:
Challenge[name] | (Text) Exactly matches | your challenge's headline
e.g.
10. For your Action step, choose Webhooks by Zapier and choose Custom Request. Configure as below:
Method: POST
URL: https://coffeesender.com/api/v2/coffees/sendData Pass-Through?: blank
Data: Insert the following code and customize the template_id to be your CoffeeSender template ID and enter a customer message in custom_message:
Basic Auth: blank
Headers: You will need the following headers. Click + to add more.
- user_key: your user key
- Content-Type: application/json
- Lead_Email: Click on the field selection icon (pictured below) and choose Contact[Email]
- partner_key: your partner key
11. Click the Continue button to test your Zap and then save and turn it on it if all is well.
Testing
To test this integration, go to Advocate View in your Hub and complete the challenge one more time. You should receive an email from CoffeeSender within a minute or two.