Freshsales
This topic describes how to integrate Medallia Agent Connect and Freshsales to send survey requests automatically when tickets are solved.
- The Team Member that has resolved the ticket has an approved Agent Connect profile.
- The customer’s record includes an email address.
- A Team Member is assigned to the ticket when it is solved.
Creating workflows that email surveys automatically
Create workflows for the Leads and Deals channels, enabling Agent Connect to email surveys to customers automatically when tickets in Freshsales are closed. This procedure includes steps for creating checkbox fields that enable agents to prevent a Agent Connect survey from being sent when they close a ticket.
- Create a Do not send Agent Connect Request field for the Leads channel.
- In Freshsales, open Admin > CRM Customization > Leads Module, and then click Add Field.
- Name the field Do not send Agent Connect Request.
-
For the Field type, select Checkbox.
-
Turn on, the Show this field in quick add property.
- Click Save.
- Configure the workflow for the Leads channel.
- In Freshsales, open Admin > Automations > Workflow, and then click Create Workflow.
- Name the workflow Send Agent Connect Survey - Lead (Demo Complete).
-
Select a record type of Lead.
-
For the Execute line, enter Execute when a record is created and run once, for each record.
- Specify the following conditions:
- Lead property - Lead stage is in Demo
- Lead property - Email status is not in None
- For the action, select Trigger Webhook.
- Click Edit webhook settings, and then specify the following information:
- Request type - POST
- Callback URL - https://api.stellaconnect.net/v1/auth
- Required authentication - on
- Username - connect
- Password - Your Agent Connect Test API Key
- Encoding - JSON
- Content type - Advanced
- In the Content box, enter the following code:
{ "employee": { "email": "#{{lead.owner.email}}" }, "channel": "#{{lead.source.name}}", "customer": { "name": "#{{lead.first_name}}", "email": "#{{lead.email}}"}, "ext_interaction_id": "#{{lead.id}}", "do_not_send": "#{{lead.cf_do_not_send_connect_survey}}", "tags": [ "#{{lead.deal.deal_product.name}}", "#{{lead.territory.name}}"]}
- Save the webhook and the workflow.
- Create a Do not send Agent Connect Request field for the Deals channel.
- In Freshsales, open Admin > CRM Customization > Deals Module, and then click Add Field.
- Name the field Do not send Agent Connect Request.
-
For the Field type, select Checkbox.
-
Turn on, the Show this field in quick add property.
- Click Save.
- Create a Deal Contact Name field for the Deals channel.
- In the Deals module, click Add Field.
- Name the field Deal Contact Name.
-
For the Field type, select Text field.
-
Turn on, the Mark this field as required property.
- Click Save.
- Create a Deal Contact Email field for the Deals channel.
- In the Deals module, click Add Field.
- Name the field Deal Contact Email.
-
For the Field type, select Text field.
-
Turn on, the Mark this field as required property.
- Click Save.
- Configure the workflow for the Deals channel.
- In Freshsales, open Admin > Automations > Workflow, and then click Create Workflow.
- Name the workflow Send Agent Connect Survey - Deal (Closed).
-
Select a record type of Deal.
-
For the Execute line, enter Execute when a record is created or updated and run recurrently, for the same record.
- Specify the following conditions:
- Deal property - Deal stage is in Won and Lost
- Deal property - Deal Contact Email is not empty
- For the action, select Trigger Webhook.
- Click Edit webhook settings, and then specify the following information:
- Request type - POST
- Callback URL - https://api.stellaconnect.net/v1/auth
- Required authentication - on
- Username - connect
- Password - Your Agent Connect Test API Key
- Encoding - JSON
- Content type - Advanced
- In the Content box, enter the following code:
{ "employee": { "email": "#{{deal.owner.email}}" }, "channel": "#{{deal.source.name}}", "customer": { "name": "#{{deal.cf_deal_contact_name}}", "email": "#{{deal.cf_deal_contact_email}}"}, "ext_interaction_id": "#{{deal.id}}", "do_not_send": "#{{deal.cf_do_not_send_connect_survey}}", "tags": ["#{{deal.deal_type.name}}", "#{{deal.deal_product.name}}", "#{{deal.territory.name}}"]}
- Save the webhook and the workflow.
- Optionally, create a workflow to automatically prevent surveys from being sent under specific conditions. Note: You do not need to create a rule specifically to limit the number of surveys that a customer receives within a specific period of time. On the Company Info screen, Agent Connect includes a suppression period that automatically stops surveys from flooding a customer within a specified number of days. For more information, see Company information.
- In Freshsales, open Admin > Automations > Workflow, and then click Create Workflow.
- Name the workflow Do not send Agent Connect request.
-
Select a record type of either Lead or Deal, as needed.
-
For the Execute line, enter Execute when a record is created or updated and run recurrently, for the same record.
- Specify the conditions that exclude a Agent Connect from being sent, according to the needs of your team.
- For the action, enter Update lead - Do Not Send Agent Connect Request - Fixed Value - Yes.
- If you use multiple brands in Agent Connect, modify the JSON payloads of your workflows to indicate the brand for each interaction. Important: You must first create a custom field in Freshsales for the brand. Add that field ID in place of CUSTOM_FIELD_ID in the examples below.
- For the Leads Channel:
{ "employee": { "email": "#{{lead.owner.email}}" }, "channel": "#{{lead.source.name}}", "customer": { "name": "#{{lead.first_name}}", "email": "#{{lead.email}}"},"brand": "#{{YOUR_CUSTOM_FIELD_ID_HERE}}", "ext_interaction_id": "#{{lead.id}}", "do_not_send": "#{{lead.cf_do_not_send_connect_survey}}", "tags": [ "#{{lead.deal.deal_product.name}}", "#{{lead.territory.name}}"]}
- For the Deals Channel:
{ "employee": { "email": "#{{deal.owner.email}}" }, "channel": "#{{deal.source.name}}", "customer": { "name": "#{{deal.cf_deal_contact_name}}", "email": "#{{deal.cf_deal_contact_email}}"}, "brand": "#{{CUSTOM_FIELD_ID}}", "ext_interaction_id": "#{{deal.id}}", "do_not_send": "#{{deal.cf_do_not_send_connect_survey}}", "tags": ["#{{deal.deal_type.name}}", "#{{deal.deal_product.name}}", "#{{deal.territory.name}}"]}
- For the Leads Channel:
- If you use multiple languages in Agent Connect, modify the JSON payloads of your workflows to indicate the language of each interaction. Important: You must first create a custom field in Freshsales for the language. Add that field ID in place of CUSTOM_FIELD_ID in the examples below.
- For the Leads Channel:
{ "employee": { "email": "#{{lead.owner.email}}" }, "channel": "#{{lead.source.name}}", "customer": { "name": "#{{lead.first_name}}", "email": "#{{lead.email}}"}, "language": "#{{CUSTOM_FIELD_ID}}", "ext_interaction_id": "#{{lead.id}}", "do_not_send": "#{{lead.cf_do_not_send_connect_survey}}", "tags": [ "#{{lead.deal.deal_product.name}}", "#{{lead.territory.name}}"]}
- For the Deals Channel:
{ "employee": { "email": "#{{deal.owner.email}}" }, "channel": "#{{deal.source.name}}", "customer": { "name": "#{{deal.cf_deal_contact_name}}", "email": "#{{deal.cf_deal_contact_email}}"}, "language": "#{{CUSTOM_FIELD_ID}}", "ext_interaction_id": "#{{deal.id}}", "do_not_send": "#{{deal.cf_do_not_send_connect_survey}}", "tags": ["#{{deal.deal_type.name}}", "#{{deal.deal_product.name}}", "#{{deal.territory.name}}"]}
- For the Leads Channel:
Moving your integration to production
Work with your Agent Connect Client Success Manager to test your automated integration, and to resolve any issues. When everything is working as expected, move your integration to production.
- In Freshsales, open Admin > Automations > Workflow.
- For each workflow you created, change the Password to your Agent Connect Production API Key (available on the Integrations screen in Agent Connect).
- In Agent Connect, open the Integrations setup screen.
- For each channel you integrated, switch that field to On, and then click Update.