Through the open interface, developers can easily and quickly access functions such as sending text messages or sending emails.
- Send SMS
- Send email
composer repuire bryce/openapi
<?php
/**
* @author Bryce<[email protected]>
* @date 2019/12/12
*/
require_once 'vendor/autoload.php';
$sms = new \Bryce\OpenApi\Sms();
$sms->setClientId('Your client id');
$sms->setClientKey('Your client key');
if ($sms->send('188****1019')) exit('Success');
else exit('Failure');
- You should have permission to send sms
- Each mobile phone number can only send 1 text message per minute, and up to 5 text messages per day.
<?php
/**
* @author Bryce<[email protected]>
* @date 2019/12/12
*/
require_once 'vendor/autoload.php';
$mailer = new \Bryce\OpenApi\Sms();
$sms->setClientId('Your client id');
$sms->setClientKey('Your client key');
if ($mailer->verifyCode('188****1019', 434307)) exit('Success');
else exit('Failure');
<?php
/**
* @author Bryce<[email protected]>
* @date 2019/12/12
*/
require_once 'vendor/autoload.php';
$mailer = new \Bryce\OpenApi\Mailer();
$mailer->setClientId('Your client id');
$mailer->setClientKey('Your client key');
if ($mailer->send('To email', 'subject', 'body')) exit('Success');
else exit('Failure');
- You should have permission to send mail
- Sending attachments is currently not supported