The transactional email campaign gives you the possibility to survey your contacts based on events triggered in your Gorgias workspace.

One of the most common scenarios is to send a survey after a ticket was marked as closed in Gorgias, but you can definitely set up one or more triggers for automations that will fit your business goals.

Follow the step-by-step tutorial to learn how to configure a transactional email campaign in Retently, and how to connect it to Gorgias events using a webhook link.

Set up a transactional email campaign in Retently

To create a new campaign, go to the Campaigns page, choose a survey metric (NPS, CSAT, CES, 5-STAR), next select email as your survey channel, and from the dropdown list with campaign types, select the Transactional option.

Assign a survey template

In the campaign editor, start with choosing the survey template that your contacts, who match this campaign, will receive in their Inbox. You can select an existing email template, or create and customize a new one.

Make sure the survey template has your company’s logo, otherwise you will not be able to select and use it.

When everything looks ok, hit the Assign button to add it as the main survey template in your campaign.

Filter your audience

As a rule, your campaign audience will be defined by the Gorgias event and only the contacts that trigger the event will be surveyed in this campaign.

However, you can apply an additional layer of filters to narrow down your audience.

Let’s assume that you have a Gorgias trigger that is fired when a ticket is closed, and you are also storing the country of your contacts as a tag. This would allow you to add some extra filters in Retently and survey only the contacts that live in a particular country.

Your audience filters would look as in the example below:

In most cases, there is no need to adjust the audience filters at all. But, if you have to, we recommend checking our article to learn more about the audience segmentation in campaigns or you can request assistance from our support team.

Edit the survey schedule

The first thing to do in the Trigger section is to specify how your surveys will be triggered. Since we are configuring this campaign for Gorgias, choose this service from the drop-down menu.

NOTE: It’s important to select the needed service because the content on the Setup page will adjust based on your choice. For our goal, we will need a webhook link that will be automatically generated and available for you to copy in the Setup section.

Next, you have three options that will help you configure how and when your surveys will be sent to your campaign’s audience:

  • Sample audience: Choose what percentage of the triggered events will result in a survey being sent. When switched off, all triggered events will result in a survey.

  • Delay survey: Send the survey at a later date from the triggered event. When switched off, the survey will be sent immediately.

  • Throttle survey: Throttle helps avoid over-surveying customers. If a customer has been surveyed recently in this campaign, then any new triggered surveys will be discarded until a specific number of days have passed since the last survey was received. When switched off, customers will be surveyed in this campaign every time they trigger an event. This option won’t affect the schedule in other campaigns.

Reminders

Reminders will help increase your survey response rate. For instance, if a contact didn't respond to your survey within three days after opening it, our system will send them a reminder email survey. This way, you will be reaching your contacts once more when they might be more likely to answer the survey.

Moreover, you can choose a different survey template for your reminders, with different wording or style, that might be more appealing to your survey respondents. You can create a new email survey template in the Templates section of your campaign or on the Templates page.

Notifications

In the Notifications section, you can create custom notifications and keep track of your progress.

When creating a new notification you will be asked to choose one or more event types you want to be notified about, the notification frequency (immediately, daily, or weekly digest), and the channel (email or Slack).

Don't forget to save your notifications and make sure they are enabled.

Autoresponders

In this section, you can create a set of email auto-responders meant to engage with contacts who did not leave any text feedback, left a Detractor score, or simply ask Promoters to leave their reviews on specific platforms and spread word-of-mouth. Autoresponders will be sent to respondents with a random delay between 5 and 60 minutes from the moment they've answered the survey.

Webhooks

Webhooks allow you to send HTTP requests to another web application every time an event is triggered, be it new feedback, a bounced survey, or an unsubscribed contact. Don't forget to save each created webhook and make sure they're enabled.

Setup

In the Setup section, you will find a unique webhook link that will be used to receive contacts data from Gorgias and trigger the transactional survey. Make sure to keep this link handy because you will need it soon when configuring the Gorgias event.

NOTE: If the webhook link is not displayed, then go back to the Trigger section and make sure that Gorgias is selected in your services drop-down menu.

Activating your campaign

The final step is to activate the transactional email campaign by switching the toggle button ON.

No surveys will be sent just yet because we haven’t connected the campaign to a Gorgias event. We will do this next!

Set up Gorgias HTTP integration to trigger your survey in Retently

Gorgias HTTP integrations let you notify external systems about a ticket's status change. In our case, we will create an HTTP integration containing the Retently webhook link. Therefore, whenever an event is triggered, the notification will go through the webhook link and will trigger the transactional survey in Retently.

To create a new HTTP integration, you will need to access the Settings area in your Gorgias workspace.

Next, go to the Integrations category, find the "HTTP" integration option, and access it.

On the HTTP page, click the "Add HTTP integration" button.

In the integration builder, give it a name and description (optional).

Next, configure the rest of the fields as described below:

  • Triggers: Choose the "Ticket updated" trigger.

  • URL: Add the Retently webhook link from the campaign's Trigger or Setup sections. Learn how.

  • HTTP Method: Choose "POST".

  • Request content type: Choose "application/json".

  • Response content type: Choose "application/json".

  • Headers: No need to add any headers.

  • Request Body (JSON): Choose "JSON template".

Basically, your setup should look like this:

The next part is important as it's related to choosing what contact data you will send to Retently when a ticket is updated. We will cover this in the next chapter.

Manage contact properties

When you've selected "JSON template" in the Request body field, an additional text input has appeared.

In this area, you have to specify what data will be sent to Retently when your Gorgias trigger is activated.

By default, Retently will accept the following data:

  • Contact's email address

  • Contact's full name

  • Ticket tags (which will be assigned as contact tags in Retently)

To pass this data to Retently, make sure the text area looks like this (you can copy the JSON code below):

{
"email": "{{ticket.customer.email}}",
"full_name": "{{ticket.customer.name}}",
"tags": "{{ticket.tags}}"
}

However, there's a set of other properties that you can import to Retently along with your contact when a ticket is updated, specifically:

  • Source

  • Ticket ID

  • Customer ID

  • Assignee Name

  • Assignee Email

  • Ticket Channel

  • Ticket Subject

  • Ticket Created Time

If you need to send one or more of these properties to Retently, you will need to create them in Retently first, based on the instructions below:

In your Retently account, access the Attributes page, To create a new one, click the "Create property" button.


A popup will ask you to write the name of the new property and choose the type of the value that will be stored in the new property. Use the property names and property types as follows:

  • source (property type: text)

  • ticket_id (property type: text)

  • customer_id (property type: text)

  • assignee_name (property type: text)

  • assignee_email (property type: text)

  • ticket_channel (property type: text)

  • ticket_subject (property type: text)

  • ticket_created_time (property type: date)

After you have created the property or properties, you can go back to your Gorgias HTTP integration, and add the new properties in the Request body field. Each property should have a corresponding Gorgias variable assigned. You can copy the whole JSON with variables (or only the needed properties) here:

{
"email": "{{ticket.customer.email}}",
"full_name": "{{ticket.customer.name}}",
"tags": "{{ticket.tags}}",
"source": "Gorgias",
"ticket_id": "{{ticket.id}}",
"customer_id": "{{ticket.customer.id}}",
"assignee_name": "{{ticket.assignee_user.name}}",
"assignee_email": "{{ticket.assignee_user.email}}",
"ticket_channel": "{{ticket.channel}}",
"ticket_subject": "{{ticket.subject}}",
"ticket_created_time": "{{ticket.created_datetime}}"
}

Note: From the properties listed above, only the email address is mandatory. The other properties are optional and you can delete them from the text area if needed.

Finally, save your Gorgias HTTP integration, and click the "Activate (or Re-activate) integration" button to start tracking ticket updates and trigger surveys in Retently.

Assign a property to a customer


Every time the "Ticket update" trigger will be fired, the contact will be added as a new contact in your Retently account, and the properties from the JSON field will be assigned, along with the values from the specified Gorgias placeholders.


Update the value of an assigned customer property

The values in a property that is already assigned to a contact will be updated automatically the next time your integration will be triggered.


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 contact's record in Retently.

IMPORTANT: Best practice

This whole setup will basically send an email survey to a contact every time their ticket in Gorgias is updated, and this might result in a lot of surveys sent to the same contact.

In order to avoid over-surveying your audience, we suggest applying the following changes:

  • Apply a specific tag to the tickets when you need to survey the ticket requester. For example, you can create a new ticket tag in Gorgias, "survey" and add it to a survey when you need to trigger the survey. To make sure that in Retently only contacts with the "survey" tag will receive a survey, go to your campaign's Audience section and add the following audience rule: Customer Tag > is > survey. Learn how.

  • In your Retently campaign's Trigger section, switch ON the Throttle option. The Throttle option makes sure that a contact can receive only one survey over a specific time frame (e.g., 30 days).

Did this answer your question?