Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
T
Twilio
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Container registry
Model registry
Monitor
Service Desk
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Extensions
Twilio
Commits
ec90665d
Unverified
Commit
ec90665d
authored
7 years ago
by
Effy Elden
Browse files
Options
Downloads
Patches
Plain Diff
Update Twilio library calls to latest version, and use the recommended 'Messages' resource
parent
c6f83d85
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
org_civicrm_sms_twilio.php
+8
-5
8 additions, 5 deletions
org_civicrm_sms_twilio.php
with
8 additions
and
5 deletions
org_civicrm_sms_twilio.php
+
8
−
5
View file @
ec90665d
...
...
@@ -26,7 +26,8 @@
*/
// Load the official Twilio library
require_once
'Services/Twilio.php'
;
require_once
'Services/Twilio/autoload.php'
;
use
Twilio\Rest\Client
;
/**
*
...
...
@@ -93,7 +94,7 @@ class org_civicrm_sms_twilio extends CRM_SMS_Provider {
)
{
$sid
=
$this
->
_providerInfo
[
'username'
];
$token
=
$this
->
_providerInfo
[
'password'
];
$this
->
_twilioClient
=
new
Services_Twilio
(
$sid
,
$token
);
$this
->
_twilioClient
=
new
Client
(
$sid
,
$token
);
}
if
(
$skipAuth
)
{
...
...
@@ -153,10 +154,12 @@ class org_civicrm_sms_twilio extends CRM_SMS_Provider {
}
try
{
$twilioMessage
=
$this
->
_twilioClient
->
account
->
sms_messages
->
create
(
$from
,
$twilioMessage
=
$this
->
_twilioClient
->
messages
->
create
(
$header
[
'To'
],
$message
array
(
'from'
=>
$from
,
'body'
=>
$message
)
);
}
catch
(
Exception
$e
)
{
$errMsg
=
$e
->
getMessage
()
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment