You are here

function hook_mobile_number_send_sms_callback_alter in Mobile Number 8

Same name and namespace in other branches
  1. 7 mobile_number.api.php \hook_mobile_number_send_sms_callback_alter()
  2. 2.0.x mobile_number.api.php \hook_mobile_number_send_sms_callback_alter()

Alter hook for setting an sms callback for using the verification functionality.

Only one sms callback can be defined and it's with this hook.

The callback gets the arguments:

  • string $phone_number (string, international format)
  • string $message (string)

If an sms module has a function with these two needed arguments, then here is where it should be defined, otherwise a wrapper function can be used.

Parameters

string $send_sms_callback: Defaults to 'sms_send' if the SMS Framework module is enabled.

1 invocation of hook_mobile_number_send_sms_callback_alter()
MobileNumberUtil::smsCallback in src/MobileNumberUtil.php
Gets sms callback for sending SMS's. The callback should accept $number and $message, and returns status booleans.

File

./mobile_number.api.php, line 23
mobile_number.api.php

Code

function hook_mobile_number_send_sms_callback_alter(&$send_sms_callback) {
  $send_sms_callback = 'my_sms_callback';
}