The <SendSMS/> Element

This element enqueues an SMS message to be delivered to a mobile number.

Element Attributes

Attribute Name Description Allowed Values Default Value
mobile_number The destination number of the message

The text of the element is used to specify the message.

After the element completes, it is possible to check if the SMS message was successfuly enqueued for delivery by checking 'SMSQueued'.

Examples

Example 1: sending a message in case of VIP client

1
2
3
4
5
6
7
8
<IVR>
  <If expr="{{CallingNumber}} == '09077777777'">
    <Then>
      <SendSMS mobile_number="{{09011112222}}">Hi, a call from {{CallingNumber}} has arrived.</SendSMS>
    </Then>
  </If>
  <Speak>Sorry, but mr. Smith is not available at the moment. He will contact you later.</Speak>
</IVR>

Example 2: sending a message to the CallingNumber and confirming it was enqueued for delivery

1
2
3
4
5
6
7
8
9
10
11
12
<IVR>
  <Speak>Hi, we are sending you a message</Speak>
  <SendSMS mobile_number="{{CallingNumber}}">Hi, this is a test message.</SendSMS>
  <If expr="SMSQueued">
    <Then>
      <Speak>Message sent! Bye.</Speak>
    </Then>
    <Else>
      <Speak>Sorry, we could not send the message. Bye.</Speak>
    </Else>
  </If>
</IVR>

Example 3: sending a ditacted message

1
2
3
4
5
6
7
8
9
10
11
12
13
14
<IVR>
  <GetInput>
    <Speak>Hi, please speak your message and I will send it to mr. Smith.</Speak>
  </GetInput>
  <If expr="SRInput">
    <Then>
      <SendSMS mobile_number="09011112222">Message from {{CallingNumber}}: {{SRInput}}</SendSMS>
      <Speak>Message sent! Bye.</Speak>
    </Then>
    <Else>
      <Speak>Bye!</Speak>
    </Else>
  </If>
</IVR>