Transactional surveys are sent when an external event is triggered. In simpler words, when something happens outside of Retently, a survey is triggered.
Retently email and in-app transactional surveys can be triggered by multiple external services.
In this article, we will cover how you can trigger a survey via Freshdesk.
Set up Freshdesk events for your survey campaign
Set up a Freshdesk automation
Freshdesk automations let you perform a specific action when a support ticket is updated to meet specific criteria.
In this tutorial, we will create an automated rule that calls a Retently webhook link when a ticket is marked as closed.
To create a new automation, access the Admin area in your Freshdesk workspace. Find the "Helpdesk productivity" subcategory and click the "Automation" option.
There are three types of automations that you can choose from:
Ticket creation: the automation will be actioned when a ticket is created.
Time triggers: the automation will be actioned after a certain amount of time has passed since the event was triggered.
Ticket updates: the automation will be actioned when a ticket is updated.
For our example, we will access the "Ticket updates" category and will create a new rule.
On the automation building page, set the criteria that your updated ticket should meet. For instance:
Status is changed -> from Any status -> to Resolved
Of course, depending on your requirements, you can configure a different set of rules.
Next, in the "Perform these actions" subcategory choose "Trigger webhook". Now we will have to configure the Retently webhook, which will receive the data when the automation is fired, and will eventually send the transactional survey.
In the “Request type” field, make sure to select the “POST” option, which means that this automation will push data to Retently.
Below, in the URL field, insert the Retently webhook link from the Trigger section in your transactional campaign.
Next, in the “Encoding” section, choose the “JSON” option. This specifies the format of the data that will be sent to Retently.
Finally, you will reach the “Content” section, where you have to specify what data will be sent to Retently.
There are two options that you can choose from: Simple, and Advanced.
Before choosing any option keep in mind the differences between them:
Simple: using this option you will be able to send to Retently only a limited number of default properties such as the contact's name, email address, and tags. Any other properties that you choose will not be added in Retently.
Advanced: using this option you will be able to send to Retently any properties that you need. This is a perfect option if you need to pass custom properties and assign them to your audience in Retently for further segmentation.
Below, we will cover how to set up each option.
Simple
This option allows you to choose a set of ticket or contact properties that will be sent to Retently. When the automation is triggered, the contact will be created in Retently as a new customer and will include these properties with the corresponding values.
If you decide to use the simple method, then keep in mind that you can only select the following properties:
Contact email (this property is mandatory)
Contact first name
Contact last name
Tags
If you need to export more properties in Retently for further data segmentation, then choose the Advanced option.
Advanced
This option gives you the possibility to export more data to Retently and store it into customer properties.
When “Advanced” is selected, a text input field will appear. In this area, you have to specify what data will be sent to Retently when your Freshdesk event is triggered.
The data in the text field has to be included in a JSON format, consisting of keys (Retently properties) and values (Freshdesk placeholders). Keys are Retently property names where the data will be stored, and values are Freshdesk placeholders that represent the data that will be stored in Retently properties.
For instance, if you want to pass a set of default properties, then your input area will include:
{
"email": "{{ticket.contact.email}}",
"first_name": "{{ticket.contact.firstname}}",
"last _name": "{{ticket.contact.lastname}}",
"tags": "{{ticket.tags}}"
}
If you need to pass other properties, then you will have to create the custom property in Retently first, and then include its name in the JSON in the text field, along with a corresponding Freshdesk placeholder name.
Let’s say that you want to pass the ticket id when the automation is triggered. You will have to create a new custom property in Retently with the name “ticket_id”.
NOTE: In the next chapter we will discuss details about managing customer properties in Retently and mapping them in the JSON text filed.
After that, you will have to include the property name in the JSON, and assign it the ticket id placeholder from Freshdesk. You can find the names of Freshdesk placeholders here.
Your JSON will look like in the example below:
{
"email": "{{ticket.contact.email}}",
"first_name": "{{ticket.contact.firstname}}",
"last _name": "{{ticket.contact.lastname}}",
"tags": "{{ticket.tags}}",
"ticket_id": "{{ticket.id}}"
}
You can pass as many properties as you need and every time the automation is triggered, the contact will be created as a new customer in Retently, the properties will be assigned, and the survey will be sent according to your campaign's schedule. If you already have this contact in Retently, then they will only be updated with the new values stored in properties, and will still receive the survey.
Manage customer props via Freshdesk automations
Using the Freshdesk integration you can assign and update customer properties every time an event is triggered.
Create customer property in Retently
Start with creating a customer property in your Retently account, in the "Props & Tags" category. To create a new one, click the "Create property" button.
A popup will ask you to write the name of the new property (ex: Subscription, Signup date, Product name, etc.) and choose the type of the value that will be stored in the new property.
Retently supports the following four data types:
Text: The value will be stored as regular text.
Number: This property can store only numbers (this data type also supports numbers with decimals).
Collection: You can store an array of keywords (ex: "item 1, item 2, item 2").
After you have created the property, it will be available to be added to your JSON text field in the Freshdesk advanced automation option.
Identify the property name
By default, in Retently props are displayed in a user-friendly format, which supports capital letters and spaces. Basically, your property will look exactly as you have written it. This is known as the property's label.
However, dues to technical requirements, when saving the property in our database, we have to transform it in a supported format: all lower-case and with underscores instead of spaces. This is known as the property name.
Whenever you want to manage properties via transactional integrations or our API, you will need to use a property's name, because the label will simply not work.
But it's very easy to figure out what is the name of a property. All you have to do is to make all the letters lower-case and replace spaces with underscores.
Below I will list a few examples so that it's easier to understand how this works:
Label: Subscription (name: subscription)
Label: Subscription Name (name: subscription_name)
Label: This Is A Custom Prop (name: this_is_a_custom_prop)
Assign a property to a customer
After you have identified the property name, all you have to do is to add it to the JSON text field in your Freshdesk automation, as described in the "Set up a Freshdesk automation" chapter above.
After that, every time when the automation will be triggered, the contact will be added as a new customer in your Retently account, and the properties from the JSON field will be assigned, along with the values from the specified Freshdesk placeholders.
Update the value of an assigned customer property
The values in a property that is already assigned to a customer will be updated automatically the next time your automation will be triggered and the contacts will match the automation rules.
Unassign customer property
Every time an automated rule is triggered, the contact's properties will be updated with the new values that will be sent via the Retently webhook. However, if no value is available for a particular property, then the property will be unassigned from the customer's record in Retently.
Click here to learn about other trigger services that we’re supporting.