Skip to content

This project allows you to integrate Frontline mobile app with your Active Campaigns contacts.

Notifications You must be signed in to change notification settings

abdulhaq/twilio-frontline-active-campaigns-setup

Repository files navigation

Twilio Frontline with Active Campaign Setup

Working for one of my client, I faild to find any example/tutorial on how to integrate Twilio Frontline with Active Campaigns. With this project you can integrate Frontline mobile app with your Active Campaign contacts.

Features

  • Pull list of your contacts from Active Campaign
  • Receieve and make calls
  • Voicemails
  • Inbound and outbound SMS with your contacts
  • Send automated SMS
  • Template Messages

Code explaination

Inbound Calls

  <Response>
      <Connect action="handleVoicemail.php">
          <Conversation serviceInstanceSid="xxxxxxx" inboundTimeout="20"/>
      </Connect>
  </Response>

serviceInstanceSid is the service ID which is found in Twilio console

Action is the url which will be called if call is not picked up or rejected.

Inbound SMS

// add agent to convo
if ($agentNum == '+14400000000') {

    $agentId = '[email protected]';
} elseif ($agentNum == '+14403000001') {

    $agentId = '[email protected]';
} elseif ($agentNum == '+1440111111') {

    $agentId = '[email protected]';
} else {

    $agentId = '[email protected]';
}

Based on phone number we can assign the SMS to different agents.

Outbound SMS

{
    "proxy_address": "+1440000000"
}

Return the number from which to send SMS

List Contacts

Return list of contacts as in the following json object

{
   "objects":{
      "customers":[
         {
            "display_name":"Diane Randi",
            "customer_id":"332"
         },
         {
            "display_name":"Sarah Kenty",
            "customer_id":"331"
         },
         {
            "display_name":"Courtney Name",
            "customer_id":"44"
         }
      ],
      "searchable":true,
      "next_page_token":"20"
   }
}

Vociemails

<Response>
    <Say voice="woman">
    Any message you want to say before voicemail recording starts
    </Say>
    <Record recordingStatusCallback="voicemail.php" />
</Response>

Return response as above with recordingStatusCallback url on which recording link will be sent once its ready.

Template Messages

[
  {
    "display_name": "General",
    "templates": [
      { "content": "Great! Let me know if you have any questions. 😀" },
      { "content": "The easiest way to get an estimate is at www.example.com" },
      { "content": "Hi ' . $contact['firstName'] . '. 👋🏻 This is agent one. Do you have any questions about your service estimate?" },
      { "content": "Let's schedule a 15 minute phone interview https://calendly.com/xxxxx/15-minute-phone-interview 😀" },
    ]
  }
]

Return JSON as above with a list of all the template messages.

Tech Stack

Server: PHP, cURL

🚀 About Me

I'm a full stack developer with experties in Twilio, Laravel, WordPress, AWS, React

🔗 Links

portfolio

linkedin

twitter

About

This project allows you to integrate Frontline mobile app with your Active Campaigns contacts.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Languages