SendSMSInformation
The SendSMSInformation action sends an SMS text message to a user during or after a conversation. The AI Employee analyzes the conversation to determine whether an SMS should be sent, validates the recipient's phone number and consent, checks for duplicates, and generates the message content from pre-configured templates. The action also handles SMS delivery errors with user-friendly messages.
Triggering events:
send_information_tool— Triggered when the AI Employee determines an SMS should be sent.send_sms_tool— Alternative trigger for SMS sending.send_sms_error— Triggered when an SMS delivery fails (from the Twilio integration). Handled by a separate error skill.
How it works
- The action checks whether the user has previously opted out of SMS (
sms_subscribedpersona attribute).- If opted out, the action asks the user for consent before proceeding.
- If consent is granted,
sms_subscribedis updated to"true".
- The action generates a schema from the allowed SMS templates.
- It analyzes the conversation to validate:
- The user's phone number (with country code) is available.
- The user confirmed the phone number is correct (or the agent promised to send).
- The agent explicitly stated it will send an SMS.
- Similar content has not already been sent (duplicate check).
- The content matches an allowed template.
- If validation passes:
- The message body is extracted from the matching template.
- Placeholders are replaced with actual data from the conversation.
- Lines with unfilled placeholders are removed.
- Newlines in the message are preserved.
- The content is translated to the agent's language if needed.
- The action checks whether the agent expects a user reply.
- The action sends an
sms_worker_send_smssystem event with the recipient phone number and message text. - The sent SMS is tracked in the
already_sent_informationpersona attribute to prevent duplicates. - If the agent expects a reply, the follow-up timer is disabled (set to manual reactivation mode) until the user responds.
Configuration
| Attribute | Description |
|---|---|
project_attributes_setting_sms_send_information_allowed_content | Defines allowed SMS templates and their content structure. |
project_business_time_zone | Time zone for datetime formatting in message content. |
Consent management
The action tracks SMS consent per user through the sms_subscribed persona attribute:
| Value | Behavior |
|---|---|
"true" | User has consented. Messages are sent without asking. |
"false" | User has opted out. The action asks for consent before sending. |
| Not set | First interaction. The action proceeds normally. |
If a user has opted out and the agent needs to send an SMS, the action sends an urgent message asking the user for permission. Only if the user agrees does the action proceed and update the consent status.
Persona attributes
| Attribute | Description |
|---|---|
sms_subscribed | Tracks whether the user has consented to receive SMS messages. |
already_sent_information | Tracks previously sent message content to prevent duplicates. |
System event sent
SendSystemEvent(
eventIdn="sms_worker_send_sms",
connectorIdn="system",
sms_text="Your appointment is confirmed for Monday at 2 PM.",
phone_number="+15551234567",
notify="true"
)
SMS delivery error handling
When an SMS fails to deliver, the send_sms_error event triggers the error handling skill. The action maps Twilio error codes to user-friendly messages:
| Error code | Meaning | Message to agent |
|---|---|---|
30024 | Numeric sender ID not provisioned | SMS temporarily cannot be sent. |
30003 | Unreachable destination | SMS cannot be sent to this phone number. |
21635 / 30006 | Landline or unreachable carrier | SMS cannot be sent to a landline. Ask for a mobile number. |
21211 | Invalid phone number | Phone number is invalid. Ask the user to clarify. |
30005 | Unknown or inactive destination | Destination unreachable. Verify the phone is on and has signal. |
The agent receives the error explanation as an urgent message and can communicate the issue to the user.
Follow-up management
| Scenario | Follow-up behavior |
|---|---|
| Agent expects a reply from the user | Follow-up timer is disabled (reactivation_mode="manual"). Re-enabled when the user responds. |
| Agent does not expect a reply | Follow-up timer continues normally. |
Analysis output
The structured generation produces a JSON object with the following fields:
| Field | Type | Description |
|---|---|---|
user_phone_number_presence | Boolean | Whether the user's phone number (with country code) is available. |
user_correctness_agreement | Boolean | Whether the user confirmed the phone number is correct. |
convo_agent_promise | Boolean | Whether the agent explicitly promised to send an SMS. |
message_body | String | The text content of the SMS (newlines preserved). |
is_duplicate | Boolean | Whether similar content was already sent. |
information_is_allowed_to_be_sent | Boolean | Whether the content matches an allowed template. |
agent_must_send_information | Boolean | Final decision: true if the SMS should be sent. |
agent_waits_user_reply | Boolean | Whether the agent expects the user to reply to the SMS. |
Example
Configure an allowed SMS template for appointment confirmations:
project_attributes_setting_sms_send_information_allowed_content = {
"appointment_confirmation": {
"body": "Hi! Your appointment at [business_name] is confirmed for [appointment_date] at [appointment_time]. Address: [address]. Reply YES to confirm or call us to reschedule."
}
}When the AI Employee confirms an appointment during a call, it automatically sends a confirmation SMS to the user's phone number with the relevant details filled in from the conversation. If the template includes a "reply" prompt, the follow-up timer is paused until the user responds.
Updated 1 day ago
