yetopen/yii2-sms-aruba

通过Aruba API发送短信

安装: 44

依赖项: 0

建议者: 0

安全: 0

星标: 0

关注者: 3

分支: 0

开放问题: 0

类型:yii2-extension

v0.1.2 2021-09-30 09:12 UTC

This package is auto-updated.

Last update: 2024-08-29 05:54:56 UTC


README

通过Aruba SMS发送短信。

安装

安装此扩展的首选方式是通过composer。

运行以下命令:

php composer.phar require --prefer-dist yetopen/yii2-sms-aruba "@dev"

或者将以下内容添加到您的composer.json文件的require部分:

"yetopen/yii2-sms-aruba": "@dev"

配置

在应用配置的components部分中,添加以下内容:

    'smsaruba' => [
        'class'     => yetopen\smsaruba\SmsAruba::class,
        'username'  => 'MyUsername',    // ArubaSMS username (Smsxxx)
        'password'  => 'MyPassword',    // ArubaSMS password ()
        'senderName' => 'Sender',       // The default sender name
    ],

用法

您可以通过调用send方法发送短信。

Yii::$app->smsaruba->send(
    ['+393344556677'],      // Enter the number(s) you want to send the message to; (the prefix is not necessary)
    'Hi, this is a test!'   // The message to send
);