yetopen / yii2-sms-aruba
通过Aruba API发送短信
v0.1.2
2021-09-30 09:12 UTC
Requires
- ext-curl: *
- yetopen/yii2-sms-sender-interface: ^0.1.1
- yiisoft/yii2: ~2.0.0
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 );