veda-consulting / org.civicrm.sms.clickatell

Clickatell integration allows delivering short message service (SMS) messages through its Clickatell Gateway to mobile phone users.
1 stars 15 forks source link

Recipient phone number is invalid or recipient does not want to receive SMS #20

Open michael-chaplin-gmcvo opened 6 years ago

michael-chaplin-gmcvo commented 6 years ago

Getting

“Recipient phone number is invalid or recipient does not want to receive SMS”

after upgrading to Clickatell 4.1 + CiviCRM 5.3.

Is it the same issue as this?

https://civicrm.stackexchange.com/questions/25478/clickatell-sms-recipient-phone-number-is-invalid-or-recipient-does-not-want-to

michael-chaplin-gmcvo commented 6 years ago

Group SMS from civicrm/sms/send?reset=1 seems unaffected but I can't send an SMS to an indvidual via an action on the contact page.

jyothi-shree21 commented 6 years ago

Yes, it is the same issue as https://civicrm.stackexchange. com/questions/25478/clickatell-sms-recipient-phone-number-is-invalid-or- recipient-does-not-want-to

It is a core Civi bug. sites/all/modules/civicrm/CRM/Activity/BAO/Activity.php is failing in function sendSMSMessage (Because $doNotSms = TRUE;) Set it to empty and it should be fine.

Try the below given patch

public static function sendSMSMessage( $toID, &$tokenText, $smsProviderParams = array(), $activityID, $userID = NULL ) { $toDoNotSms = ""; $toPhoneNumber = "";

if ($smsProviderParams['To']) {

Thanks, Jyothi

On 11 July 2018 at 09:50, mikantchap notifications@github.com wrote:

Group SMS from civicrm/sms/send?reset=1 seems unaffected but I can't send an SMS to an indvidual via an action on the contact page.

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/veda-consulting/org.civicrm.sms.clickatell/issues/20#issuecomment-404094243, or mute the thread https://github.com/notifications/unsubscribe-auth/ATMZIoxNHwQC-l6WATvojN8rw466T4rzks5uFbxogaJpZM4VKuRq .

--

Jyothi Shree G

Civicrm Lead Developer

vedaconsulting.co.uk

+44 (0) 33 3011 8874

90 Mainyard, 90 Wallis Rd London, E9 5LN

https://twitter.com/vedaconsulting https://www.facebook.com/vedaconsulting https://uk.linkedin.com/in/vedaconsulting

michael-chaplin-gmcvo commented 6 years ago

Thanks for that...is this a reported issue with CiviCRM? If so could you post a link?

My activity file looks different to the above:

public static function sendSMSMessage( $toID, &$tokenText, $smsProviderParams = array(), $activityID, $sourceContactID = NULL ) { $doNotSms = TRUE; $toPhoneNumber = NULL;

if ($smsProviderParams['To']) {

Should I just set

$doNotSms = NULL; ?

And would this patch mean that all users will receive the SMS regardless of their preference?

Thanks Mike

jyothi-shree21 commented 6 years ago

Yes, set $doNotSms = NULL; This patch allows all users receive the SMS regardless of their preference.

michael-chaplin-gmcvo commented 6 years ago

Any chance of this fix going into a release? Just upgraded to 5.3.1 and it broke again.

Thanks Mike

clarkac1 commented 6 years ago

This appears to be broken in 5.4.0. Also it fails in this way on one system - where the user has SMS preference set to Yes but works OK on a different 5.4.0 system! This is using Twilio.

clarkac1 commented 6 years ago

I applied the above patch (setting $doNotSms = NULL;) to line 1829 of activity.php and it fixes the problem, for now anyway. But as you say, it ignores the user preference, so a real fix is needed, please.

davejenx commented 6 years ago

Civi core issue: https://lab.civicrm.org/dev/core/issues/273 Fix: https://github.com/civicrm/civicrm-core/pull/12634