/**
  * Send SMS
  */
 static function ws_sms_send($data)
 {
     $general_settings = get_option('ws_main_option', array());
     if (!class_exists('Mailin')) {
         require_once 'mailin.php';
     }
     $mailin = new Mailin(WC_Sendinblue::sendinblue_api_url, $general_settings['access_key']);
     $result = $mailin->send_sms($data);
     delete_transient('wswcsbcredit_' . md5($general_settings['access_key']));
     return $result['code'];
 }
Esempio n. 2
0
<?php

require '../mailin.php';
/*
 * This will initiate the API with the endpoint and your access and secret key.
 *
 */
$mailin = new Mailin('https://api.sendinblue.com/v1.0', 'Your access key', 'Your secret key');
/*
 * This will send an SMS
 *
 */
var_dump($mailin->send_sms("1231231313", "From!", "This is a test", "http://example.com", "tag1"));
Esempio n. 3
0
<?php

require 'Mailin.php';
/*
 * This will initiate the API with the endpoint and your access key.
 *
 */
$mailin = new Mailin('https://api.sendinblue.com/v2.0', 'Your access key');
/*
 * This will send a transactional SMS
 *
 */
/** Prepare variables for easy use **/
$data = array("to" => "+331234567890", "from" => "From", "text" => "Good morning - test", "web_url" => "http://example.com", "tag" => "Tag1", "type" => "");
var_dump($mailin->send_sms($data));