ianchadwick/dynmark

使用 Dynmark 发送短信 - http://www.dynmark.com/

dev-master 2016-08-25 16:27 UTC

This package is not auto-updated.

Last update: 2024-09-25 15:13:07 UTC


README

Dynmark 是 SMS 和 SMS 智能服务的主要提供商,使您的短信消息更加智能。

此包允许您使用他们的 API 发送短信。查看网站

要求

PHP 5.4+

使用 Composer 进行安装

将 ianchadwick/dynmark 添加到您的 composer.json 文件的 require 部分

"require": {
  "ianchadwick/dynmark": "dev-master"
}

然后使用 composer 更新您的项目

composer update

基本用法

use Dynmark\Dynmark;
use Dynmark\Commands\Sms\Send;

class MyClass {
  public function sendSms()
  {
    // init the Dynmark helper
    $dynmark = new Dynmark('myusername', 'mypassword');
    
    // create the command
    $command = new Send($dynmark);

    // set the text details
    $command->setFrom('Ian')
        ->setPhone('0770000000')
        ->setText('Hello there!');
    
    // send the text
    $response = $command->fire();
  }
}