According to the documentation on SMS recipient resolution:
* if
recipient
resolution does not yield a phone number, it will default to submitter’s phone number
Can we disable this SMS redirection?
In my project, a patient can be registered with or without a phone number.
If the patient is registered with a phone number, I want to send a message to the patient at the time of registration, and every time a new form is submitted for the patient. It is working fine using the configurations for registrations
and patient_reports
.
However, if the patient does not have a phone number, it sends the same message to the submitter. I don’t want it. The message shouldn’t go out if the patient doesn’t have a phone number. How can I achieve this?
Sample configuration:
"registrations": [
{
"form": "A",
"events": [...],
"validations": {...},
"messages": [
{
"translation_key": "messages.registration.a.clinic",
"event_type": "report_accepted",
"recipient": "clinic"
},
{
"translation_key": "messages.registration.a.patient",
"event_type": "report_accepted",
"recipient": "patient.phone"
}
]
}
Here, the message intended for the patient (messages.registration.a.patient
) should only go to the patient, provided that patient.phone
is available. Otherwise, this message should be skipped.