in Tags: wordpress

INDEX


Hooks and Actions

This section is specifically for developers who wish to extend the functionality of this plugin as per their needs.

To Send SMS

do_action('sa_send_sms', '918010551055', 'Here is the sms.');

To Modify Parameters before sending any SMS
function modify_sms_text($params){
//do your stuff here
return $params;
}
add_filter('sa_before_send_sms', 'modify_sms_text');
To get SMS Alert Service Response after Send SMS
function get_smsalert_response($params)
{
//do your stuff here
return $params;
}
add_filter('sa_after_send_sms', 'get_smsalert_response');
Woocommerce before Send SMS to Customer
function modify_sms($params, $wc_order_id)
{
//do your stuff here
return $params;
}
add_filter('sa_wc_order_sms_customer_before_send', 'modify_sms', 1, 2);
Woocommerce before Send SMS to Admin
function modify_sms($params, $wc_order_id)
{
//do your stuff here
return $params;
}
add_filter('sa_wc_order_sms_admin_before_send', 'modify_sms', 1, 2);
OTP Verification

you can enable OTP verification in any form using the below shortcode. You just need change Phone number field jquery selector field and submit button selector. In the example below just change .sa-phone-field and .sa-hide as per your form.

[sa_verify phone_selector=".sa-phone-field" submit_selector=".sa-hide"]
FAQ’s
  1. How can i send SMS to Shipping Phone instead of Billing Phone?

    By default woocommerce does not have any shipping phone field, but in case if you have added a custom phone field in your woocommerce powered website, you can place this code in your functions.php file which is located in your theme folder.

    function modify_sms($params, $wc_order_id)
    {
          if( !$wc_order_id ) {
                return $params;
          }
          //please ensure to replace '_shipping_phone' with appropriate variable
          $params['number'] = get_post_meta( $wc_order_id, '_shipping_phone', true );
          return $params;
    }
    add_filter('sa_wc_order_sms_customer_before_send', 'modify_sms', 1, 2);

Still can't find the solution for your Query?

Contact Support