0

I am using modules "SMS Framework",Clickatell for sending message and I have configured all the settings which was required. I have also created a rule where node (Article) be saved and send a message.

It is working good when I use single mobile number but unfortunately it is not working when I use multiple mobile number with comma separated.

0

The rules action calls sms_send, whose first argument is:

The destination number.

i.e. singular. So the module doesn't have support for sending to multiple, comma-separated numbers in one go through rules. It is in alpha to be fair, so it's not likely to be fully-featured yet.

Two ways you could get around this limitation (there are probably more):

  1. Create a custom rules action which splits the incoming string by comma, then loops over and calls sms_send on each. If you choose this method, contributing the code back to the project would I'm sure be greatly appreciated.
  2. Restructure your workflow so the existing rule is invoked once, in a loop, for each phone number.
0

Step 1: Transform your data into a list

The Rules Data Transforms module (DEV version only!) may help to solve your issue. It supports the transformation of a string of values separated by some separator (such as a comma) into a list. So you should be able to transform your "multiple mobile number with comma separated" (as in your question) into a list. There doesn't seem to be any documentation available about this module, except:

Step 2: Typical list processing with Rules

After you succeeded in transforming your mobile numbers into a list, you should be able to perform the typical list processing using Rules. If you're not familiar with that, have a look at the tutorial titled "Lists and loops". Starting from about 7:00, it shows how in a Rules Action you can access the 1st, or 2nd, or ... value of a multiple value field, provided you also included a Rules Condition like "Content is of type" (related to the multi value field). If you consider the field_tags in this video as the equivalent of your field containing the mobile numbers, it's pretty similar to your case. Have a look at this video from the beginning to understand how this rule works.

Specific to your case, all you'd have to do is to adapt the Rules Action in the rule you already have, i.e. by adding an appropriate loop, and then add a action for each list item in that loop (which is similar to the Rules Action you already have).

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.