SMS

Sending Text Messages

Your mashlets can send SMS messages using the SMS provider configured on your Foldr (Twilio is the default). Messages are queued for delivery and can be sent immediately or scheduled with a delay.

send

mash.comms.sms.send(String: recipient, String: message, Number: ?delay = null)

Send an SMS message.

Parameters

recipient

A valid mobile number in international format, e.g. +447700900123.

message

The message body in plain text. Long messages are split into multiple SMS segments by the provider; you’ll typically be billed per segment.

delay (optional)

A number representing a period in seconds to wait before sending the message.

Natural

# Send a message immediately.
mash.comms.sms.send("+447700900123", "Your Captur extraction has finished")

printline "SMS sent"

# Send a reminder 60 seconds from now.
mash.comms.sms.send("+447700900123", "Reminder: meeting at 3pm", 60)

printline "SMS scheduled"

Notes

SMS sending requires an SMS provider to be configured on Foldr. If no provider is configured, calls to mash.comms.sms.send raise a runtime error. Configure a provider in Foldr Settings → Comms → SMS.

← All articles