wp_sms_send()

Updated on May 25, 2022

Description

This function can be used in your theme or plugin for sending SMS easily!

Parameters

wp_sms_send( $to, $msg, $is_flash = false, $from = null, $mediaUrls = [] );
  • $to (array) (Required) The receiver number or numbers.
  • $msg (string) (Required) The SMS text message.
  • $is_flash (boolean) (Optional) Only if you want to send flash SMS.
  • $from (int) (Optional) Sender ID
  • $mediaUrls (array) (Optional) Media URLs for sending via MMS

Example

Send SMS to multi numbers.

$to = array('+1111111111', '+1111111112');
$msg = "Your Message";
wp_sms_send( $to, $msg);

Send Flash SMS

$to = array('+1111111111', '+1111111112');
$msg = "Your Message";
wp_sms_send( $to, $msg, true);

Send MMS

$to = array('+1111111111', '+1111111112');
$msg = "Your Message";
$urls = ['https://imageurl.com'];
wp_sms_send( $to, $msg, false, null, $urls);