SmsWebhookRK
|
Class for setting parameters for a SMS message. More...
#include <SmsWebhookRK.h>
Public Member Functions | |
SmsMessage () | |
Default constructor - doesn't really do anything. | |
virtual | ~SmsMessage () |
Default destructor - doesn't really do anything. | |
SmsMessage & | withRecipient (const char *phoneNum) |
Sets the recipient phone number. More... | |
const char * | getRecipient () const |
Gets the previously set phone number. | |
bool | hasRecipient () const |
Returns true if the recipient is a non-empty recipient string. | |
SmsMessage & | withMessage (const char *message) |
Sets the SMS message text. More... | |
const char * | getMessage () const |
Gets the previously set message text. | |
Protected Attributes | |
String | recipient |
Recipient phone number (+ country code format) | |
String | message |
Message text to send. | |
Class for setting parameters for a SMS message.
You typically use it like:
|
inline |
Sets the SMS message text.
message | The SMS message text, limited to 140 characters. |
This method makes a copy of message string. If you don't set the message string, the Twilio API won't let you send an empty SMS, so an error will show in the integration log.
|
inline |
Sets the recipient phone number.
phoneNum | Recipient phone number in + country code format, so for example, in the United States it begins with +1 . The rest of the phone number should be be just digits, no punctuation. |
This method makes a copy of phoneNum string.
Instead of specifying the recipient in each SmsMessage object, you can use withRecipientCallback(). Providing a function to get the recipient is handy if you're storing the recipient in EEPROM or a file on the file system.