0

Wordpress 5.5.3, CiviCRM 5.31.0. While testing Mass SMS with new Twilio account we've discovered it does not quite work. Searching for a solution here and across lab.civicrm.org haven't helped much. Logs are empty so it is not an error or is not considered as an error by CiviCRM. The most popular related solution ( replace "is_deceased" from NULl to 0 in the database ) hasn't helped. Mass mailing works fine and the number of recipiens counted is correct. Individual SMS sending works also. The only clues we have are:

  • "Send SMS" action is not visible for individual contacts.
  • Attempt to create Mass SMS for all contacts in the database ( around 10 000 ) displays only 5 contacts on "Total Recipients: 5" counter. Probably it is something with data in the database. We were having big updates for both wordpress and civi past weeks on a decent hosting so things might have been a little messy. The question is, where to start with debugging. Perhaps, if we saw which exactly contacts were counted, we would be able to find what all these 5 have in common and figure out the next steps. Any clue will be helpful.
9
  • Quick question: do all the recipients have the phone type set to Mobile?
    – Demerit
    Dec 5 '20 at 0:05
  • 1
    are all the phones set up as Mobile? Do they all have a verifiable mobile number? Can you send individual SMS to any of the numbers that are not included in the 5 that show?
    – petednz - fuzion
    Dec 5 '20 at 1:26
  • @Demerit thank you for your note: unfortunately, the most of them have. I've even tried to change phone type from Home -Mobile to Main - Mobile hoping it will make any difference - no dice.
    – yurg
    Dec 6 '20 at 15:00
  • Ok another thing to check is if the contacts have "Do not SMS" checked under the communication prefs accordion on their contact record.
    – Demerit
    Dec 6 '20 at 15:13
  • 1
    Use the Dummy SMS extension to send. Then you can see without actually sending.
    – Demerit
    Dec 6 '20 at 17:16
2

The only logical explanation to the above was that someone had overwritten Phone to Mobile and Mobile to Phone which was why you were seeing perverse results.

Checking in log_civicrm_option_value table for option_group_id = 35 (which is phone type) and seeing if it has changed and if so when/who may confirm this

1
  • accepted, thank you.
    – yurg
    Dec 8 '20 at 15:22
2

Kudos to Demerit and petednz-fuzion for helpful pointers, see below:

  • Demerit: Dummy SMS extension
  • petednz-fuzion: check your log_civicrm_option_value table for option_group_id = 35 to see who changed it

It is possible to find recipients of each mailing (even scheduled/not sent) via MySQL following these steps:

  1. Table log_civicrm_mailing gives us our Mass SMS id
  2. Table civicrm_mailing_recipients contains all recipients of all mailings (mass sms included) in the format: mailing_id/contact_id/email_id/phone_id
  3. From here we can explore each "phone_id" record in civicrm_phone table, where we can see "phone_type_id".

And this is a funny part: all my 5 recipients have phone_type_id=2 ("Phone") while "Mobile" phone type has phone_type_id=1. So, it seems Mass SMS in my case checks if phone type is Phone, not Mobile.

Advanced Search by "Phone type=Phone" returns only 3 numbers, but it seems to be another story. Perhaps, it worth checking what exactly happens on line 227 of \CRM\Mailing\BAO\Mailing.php in this regards:

'location_filter' => CRM_Utils_SQL_Select::fragment()->where("$entityTable.phone_type_id = " . CRM_Core_PseudoConstant::getKey('CRM_Core_DAO_Phone', 'phone_type_id', 'Mobile')),

Bingo!

6
  • "funny part: all my 5 recipients have phone_type_id=2 ("Phone")" This doesn't seem correct and is core of your issue I think. Compare with dmaster.demo.civicrm.org/civicrm/admin/… - where you will see Phone option is 1 and Mobile option is 2
    – petednz - fuzion
    Dec 6 '20 at 18:06
  • 1
    and check your log_civicrm_option_value table for option_group_id = 35 to see who changed it
    – petednz - fuzion
    Dec 6 '20 at 18:08
  • or is it a translation issue?
    – petednz - fuzion
    Dec 6 '20 at 18:09
  • @petednz-fuzion Wish I could add x100 votes for "log_civicrm_option_value table for option_group_id = 35" - this one is priceless. I've been asked to check this setup so have no clue who did what there.
    – yurg
    Dec 6 '20 at 20:33
  • if you mean 'yes, that was the problem' should i add it as another answer - or do you want to add to yours.
    – petednz - fuzion
    Dec 7 '20 at 0:10

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.