A conglomeration of my CWilio and CWSlack repositories to create a ConnectWise integrated Slack SMS system using the Twilio API
Using just the Twilio/Slack part of this may be helpful, but it really shines once you integrate ConnectWise as it will then log the conversation to the internal notes of a ticket.
Example pictures: http://imgur.com/a/SzMzk
This assumes Twilio, ConnectWise, and Slack are functional and ready to go.
- Download the repository and copy all files to a web accessible location on a webserver that supports cURL, PHP, and MySQL/MariaDB. Tables and Database will be setup automatically if the proper permissions are available.
- Setup a new Slack slash command and webhook and save the token and URL. Slash command must use GET not POST.
- Open sms-config.php in your favourite text editor and fill out the values according to the comments. ALL values are required excluding the "Other" section and below.
- From the channel specified in $slackchannel, try /sms (phone number) (message)
- Setup a cron job or scheduled task on your server to run the PHP file cwilio-sms-cron.php every hour.
Cron: 0 */1 * * * /usr/bin/php /var/www/cwilio-sms-cron.php >/dev/null 2>&1
- If you have issues, please set $debugmode to true in sms-config.php and log a GitHub issue if you can't determine the issue.
- Login to ConnectWise
- In the top right, click on your name
- Go to "My Account"
- Select the "API Keys" tab
- Click the Plus icon to create a new key
- Provide a description and click the Save icon.
- Save this information, you cannot retrieve the private key ever again so if lost you will need to create new ones.
- /sms (phone number) (message) - Sends a messsage to specified phone number
- /sms (ticket number) (message) - Sends a message to the number of the ticket contact, attaches ticket to thread.
- /sms (First name) (Last name)|(message) - Sends a message to the specified ConnectWise contact.
- /sms attach (phone number) (ticket number) - Attaches a current thread to a ticket for logging
- /sms detach (phone number) OR (ticket number) - Stops an ongoing thread.