Overview
Special Note about SMS in India
In order to send SMS to an Indian number, that number may need to opt-in to receive SMS. It's a best practice to have each Indian number you want to send sms to follow the opt-in process. Details can be found here: SMS In India
To send a phone number to a case (ex. to a pregnant mother), the phone number and some additional details need to be stored in the case. At the moment, CommConnect only supports a single phone number in the case. For example, while you may be able to store both both a mother and husband's phone number in the case, only one of the two will be supported for CommConnect.
The following properties need to be included in the case:
- contact_phone_number - This is the phone number to send messages to. It should include the country code (ex. 1 for the USA or 91 for India) and the rest of the phone number. It should not have any spaces, dashes or other punctuation. For example, both "12066181323" and "910981231234" are valid values. "1-206-617-1234" will not work.
- contact_phone_number_is_verified - This should be set to "1" to indicate that the phone number has been verified and is a real number.
Basic Form Setup
In a form that creates or updates the case, you can do the following to quickly enable CommConnect.
- Add a question with an ID of contact_phone_number of type "Phone Number or Numeric ID". Its important that you use "Phone Number" as an "Integer Number" cannot store enough digits for a phone number.
- Add a hidden value to the form with an ID of contact_phone_number_is_verified. You can set the calculate condition for this hidden value to evaluate to 1 if phone number was entered or 0 otherwise. Ex. if(/data/contact_phone_number != '', 1, 0)
- Important: Make sure that the form creates or updates a case, and that these properties are stored in the case.
Notes
- All Phone Numbers Must Be Unique.
If a phone number is shared with another CommConnect-enabled case or verified or a mobile worker (even in another project), messages will not be sent. To address this issue, close at any other cases using that phone number or delete the verified number from the mobile worker. - Verifying a Number
The example above automatically marks an added phone number as verified. Alternatively, you may have the health worker tries to call or text the user. Once this has been done successfully, they can use a form to set the value of contact_phone_number_is_verified to 1.