Freshsales

Integrate Agent Connect with Freshsales.

This integration guide describes how to connect 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.

Create workflows

You will need to create workflows for the Leads and Deals channels, enabling Agent Connect to email surveys to customers automatically when tickets in Freshsales are closed.

At the same time, you will also need to create check box fields that enable agents to prevent an Agent Connect survey from being sent when they close a ticket, since there will be some scenarios in which surveys should not be sent.

Note: Inform the Agent Connect team of the Freshsales channels you use, since Freshsales passes names differently (such as Email rather than email).
  1. Create a Do not send Agent Connect Request field for the Leads channel:

    1. In Freshsales, open Admin > CRM Customization > Leads Module, then click Add Field.

    2. Name the field Do not send Agent 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. Open Admin > Automations > Workflow, then click Create Workflow.

    2. Name the workflow Send Agent 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, then specify the following information:

      Leads channel webhook settings
      • Request type — POST

      • Callback URL — https://api.stellaconnect.net/v1/auth

      • Required authentication — On

      • Username — connect

      • Password — Enter 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}}"]
        }
    8. Save the webhook and the workflow.

  3. Create a Do not send Agent Connect Request field for the Deals channel:

    1. Open Admin > CRM Customization > Deals Module, then click Add Field.

    2. Name the field Do not send Agent 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 in the same way as the Deal Contact Name field.

  6. Configure the workflow for the Deals channel:

    1. Open Admin > Automations > Workflow, then click Create Workflow.

    2. Name the workflow Send Agent 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 or 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, then specify the following information:

      Deals channel webhook settings
      • 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}}"]
        }
    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 page, 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 Info page.
    1. Open Admin > Automations > Workflow, then click Create Workflow.

    2. Name the workflow Do not send Agent 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 an Agent Connect survey from being sent, according to the needs of your team.

    6. For the action, enter "Update lead - Do Not Send Agent 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": "#{{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}}"
          },
          "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}}"]
      }

Move your integration to production

Work with the Agent Connect team to test your automated integration and 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 page in Agent Connect).

  3. In Agent Connect, open the Integrations setup page.

  4. For each channel you integrated, switch that field on, then click Update. Integrated Channels in Stella Connect