| Time | Status | User Agent | |
|---|---|---|---|
Retrieving recent requests… | |||
Overview
This action sends a text/SMS message to the recipient using Twilio.
Test Mode SMS Restrictions
The SMS action includes built in safety logic to prevent accidental text messages during testing or development.
Event Test Mode Check
When an Action is associated with an Event, that Event has a TestMode boolean property.
When TestMode is true, the SMS action applies phone number filtering.
Allowlist Configuration
The system checks the TestModeSMSPhoneNumberAllowList setting stored in the Settings table.
This setting contains a list of phone numbers that are allowed to receive messages during testing.
Number Comparison
The system extracts digits only from the resolved phone number using StringHelper.DigitsOnly.
This removes formatting like plus signs, hyphens, spaces, and parentheses.
It checks whether the resulting digits exist in the allowlist.
If your allowlist contains 5551234567, it will match numbers formatted as:
- +1 (555) 123 4567
- 555 123 4567
- 555-123-4567
Filtering Logic
If TestMode is false, all phone numbers are allowed.
If TestMode is true and the phone number is in the allowlist, the SMS is sent.
If TestMode is true and the phone number is not in the allowlist:
- A log entry is created:
Phone number removed due to test policy - An exception is thrown:
"To" property has resolved to an empty string" - The SMS is not sent
Why This Exists
This prevents developers and testers from accidentally sending SMS messages to real customers.
You can safely test Events using production like data without sending messages to actual phone numbers.
Configuration
The TestModeSMSPhoneNumberAllowList commonly includes:
- Developer or QA team mobile numbers
- Test phone numbers
- A company owned Twilio test number
Important Note
The error message "To" property has resolved to an empty string" is misleading.
The phone number did not resolve to empty. It was intentionally filtered out by test mode rules.
The real reason is visible in the system logs.
Practical Usage
When setting up a test Event that sends SMS:
- Set
Event.TestMode = true - Add your test phone numbers, digits only, to
TestModeSMSPhoneNumberAllowList - Trigger the Event
Only allowlisted numbers receive SMS messages - When ready for production, set
Event.TestMode = falseto disable filtering