PHP code example of camoo / wp-camoo-sms
1. Go to this page and download the library: Download camoo/wp-camoo-sms library . Choose the download type require .
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
camoo / wp-camoo-sms example snippets
$to = array('+23761732567');
$msg = "Hello kmer World! Déjà vu!";
wp_camoo_sms_send( $to, $msg );
wp_camoo_sms_send
function send_mail_when_send_sms($message_info) {
wp_mail('[email protected] ', 'Send SMS', $message_info);
}
add_action('wp_camoo_sms_send', 'send_mail_when_send_sms');
wp_camoo_sms_add_subscriber
function send_sms_when_subscribe_new_user($name, $mobile) {
$to = array($mobile);
$msg = "Hi {$name}, Thanks for subscribe.";
wp_camoo_sms_send( $to, $msg )
}
add_action('wp_camoo_sms_add_subscriber', 'send_sms_when_subscribe_new_user', 10, 2);
wp_camoo_sms_from
function wp_camoo_sms_modify_from($from) {
$from = $from . ' 0';
return $val;
}
add_filter('wp_camoo_sms_from', 'wp_camoo_sms_modify_from');
wp_camoo_sms_to
function wp_camoo_sms_modify_receiver($numbers) {
$numbers[] = '67xxxxxxxx';
return $numbers;
}
add_filter('wp_camoo_sms_to', 'wp_camoo_sms_modify_receiver');
wp_camoo_sms_msg
function wp_camoo_sms_modify_message($message) {
$message = $message . ' /n Powered By: WP-CAMOO-SMS';
return $message;
}
add_filter('wp_camoo_sms_msg', 'wp_camoo_sms_modify_message');
if (isset($_POST['my_submit'])) {
add_filter('my_filter', [\CAMOO_SMS\Admin\Helper::class, 'sanitizer']);
}
$input = \CAMOO_SMS\Admin\Helper::sataniseRequest('my_filter', $input);
wp_camoo_sms_subscribes();