In this article we will learn how to send campaigns from Mailmodo triggered by events recorded in Zendesk.

Use Case

Send a campaign from Mailmodo for triggers and automations recorded in Zendesk. Triggers are business rules you define that run immediately after a ticket is created or updated and automatically perform actions if specified conditions are met. Automations take action to modify ticket properties at a specified time after a ticket is updated. 

For eg. Every time a ticket is solved, an automated email will be sent to the end user asking them about their overall experience. Similar emails can be sent for a range of triggers and automations.

Overview

In this article, we will cover-

1. Creating a transactional campaign in Mailmodo

2. Zendesk setup

2.1 Creating a webhook in Zendesk

2.2. Creating a trigger or automation in Zendesk

Creating a transactional campaign in Mailmodo

Step 1- Navigate to the Templates category. Click on Create New Template.

Step 2- Create a template using the editor. Upon completion, save and rename the template. 

Step 3- Navigate to Transactional from the vertical menu on the left.

Step 4- Create a new transactional campaign. Select the template you saved before. Click on Next.

Step 5- Add details like campaign name, subject line, pre-header text, from name and reply to email. Click on Next.

Step 6- Select Zendesk as the external trigger. Click on Next.

Step 7- Review and send test campaign. Once done, click on Enable Campaign.

Step 8- Copy the webhook URL generated on the trigger info page.


Zendesk Setup

Creating a webhook in Zendesk

Step 1- Navigate to Admin from the Zendesk dashboard.

Go to Admin Center.

Step 2- Navigate to Apps and Integrations from the Admin Center dashboard. Select webhooks from the list.

Step 3- Go to Actions>Create Webhook

Step 4- Name the webhook. Paste the webhook URL (in the Endpoint URL field) copied from Mailmodo's trigger info section.

Step 5- Select Request method as POST. Select Request format as JSON. Select None under Authentication.

Step 6- Click on Test webhook. Select Test event source as Custom test. Paste the following in the Request JSON Body.

{  "email": "john@example.com",  "data": {} }

Replace john@example.com with the email id on which you want to receive the test email.

Click on Send test.

You should receive 200 OK as response. This means your webhook is working.

Check your inbox to view the test email sent from Mailmodo.

Step 7- Once you have successfully tested your webhook, click on Create.

Click on Complete setup. A modal will open, select leave without connecting.

You would be able to see the webhook status as active.

You have successfully created a webhook. Now, connect your webhook to a trigger or automation for it to work.

Creating a trigger or automation in Zendesk

Step 1- Go to Object and Rules from the admin dashboard on the left. Navigate to Business rules. Click on triggers or automations depending on your use case.

Note- For the purpose of this tutorial, we are going to create a Trigger. Automations can be created in a similar manner. Your webhook can be connected to a trigger as well as an automation. 

Step 2- Click on Add trigger.

Name the trigger, give an appropriate description. Select a pre-existing category or create a new category.

Step 3- Configure the trigger conditions.

Step 4- Under Actions, click on Type or select actions.

Select Action as Notify active webhook

Select the webhook you created before.

Upon selecting the webhook, you would be able to see the webhook details. 

Step 5- Paste this in the JSON body.

{  "email": "",  "data": {    "First Name": ""  } }

Map email and first_name to the corresponding attributes in Zendesk as shown below. You can add other parameters in the data key.

Copy the attribute value from View available placeholders. Paste the value in JSON body.

Once the webhook body is configured, click on Create. Your trigger is successfully saved.

Navigate back to Apps and Integrations>Webhooks. The webhook status would be active.

Click on the three dots besides webhook name. Click on view details.

Navigate to Event Subscription. Your trigger should be visible here.

You have successfully created a trigger campaign. Every time the trigger event occurs, an email will be sent to the corresponding contact.