Freshsales

This topic describes how to integrate Medallia Agent Connect and Freshsales to send survey requests automatically when tickets are solved.

Important: Agent Connect can send surveys automatically only when the following criteria are met:
  • 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.

Note: Inform your Agent Connect Client Success Manager of the Freshsales channels you use. Because Freshsales passes names differently (such as Email and not email), your Client Success Manager they will configure Agent Connect correctly.
  1. Create a Do not send Stella Connect Request field for the Leads channel.
    1. In Freshsales, open Admin > CRM Customization > Leads Module, and then click Add Field.
    2. Name the field Do not send Stella Connect Request.
    3. For the Field type, select Checkbox.

    4. Turn on, the Show this field in quick add property.

    5. Click Save.
  2. Configure the workflow for the Leads channel.
    1. In Freshsales, open Admin > Automations > Workflow, and then click Create Workflow.
    2. Name the workflow Send Stella Connect Survey - Lead (Demo Complete).
    3. Select a record type of Lead.

    4. For the Execute line, enter Execute when a record is created and run once, for each record.

    5. Specify the following conditions:
      • Lead property - Lead stage is in Demo
      • Lead property - Email status is not in None
    6. For the action, select Trigger Webhook.

      Leads channel workflow settings

    7. 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}}"]}

      Leads channel webhook settings

    8. Save the webhook and the workflow.
  3. Create a Do not send Stella Connect Request field for the Deals channel.
    1. In Freshsales, open Admin > CRM Customization > Deals Module, and then click Add Field.
    2. Name the field Do not send Stella Connect Request.
    3. For the Field type, select Checkbox.

    4. Turn on, the Show this field in quick add property.

    5. Click Save.
  4. Create a Deal Contact Name field for the Deals channel.
    1. In the Deals module, click Add Field.
    2. Name the field Deal Contact Name.
    3. For the Field type, select Text field.

    4. Turn on, the Mark this field as required property.

    5. Click Save.
  5. Create a Deal Contact Email field for the Deals channel.
    1. In the Deals module, click Add Field.
    2. Name the field Deal Contact Email.
    3. For the Field type, select Text field.

    4. Turn on, the Mark this field as required property.

    5. Click Save.
  6. Configure the workflow for the Deals channel.
    1. In Freshsales, open Admin > Automations > Workflow, and then click Create Workflow.
    2. Name the workflow Send Stella Connect Survey - Deal (Closed).
    3. Select a record type of Deal.

    4. For the Execute line, enter Execute when a record is created or updated and run recurrently, for the same record.

    5. Specify the following conditions:
      • Deal property - Deal stage is in Won and Lost
      • Deal property - Deal Contact Email is not empty
    6. For the action, select Trigger Webhook.

      Deals channel workflow settings

    7. 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}}"]}

      Deals channel webhook settings

    8. Save the webhook and the workflow.
  7. 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.
    1. In Freshsales, open Admin > Automations > Workflow, and then click Create Workflow.
    2. Name the workflow Do not send Stella Connect Request.
    3. Select a record type of either Lead or Deal, as needed.

    4. For the Execute line, enter Execute when a record is created or updated and run recurrently, for the same record.

    5. Specify the conditions that exclude a Agent Connect from being sent, according to the needs of your team.
    6. For the action, enter Update lead - Do Not Send Stella Connect Request - Fixed Value - Yes.
  8. 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}}"]}
  9. 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}}"]}

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.

  1. In Freshsales, open Admin > Automations > Workflow.
  2. For each workflow you created, change the Password to your Agent Connect Production API Key (available on the Integrations screen in Agent Connect).
  3. In Agent Connect, open the Integrations setup screen.
  4. For each channel you integrated, switch that field to On, and then click Update.

    Integrated Channels in Stella Connect