sms77 / craft
v1.0.0
2021-04-20 09:08 UTC
Requires
- craftcms/cms: ^3.1.0
- sms77/api: ^2.3.0
This package is auto-updated.
Last update: 2023-12-15 13:16:49 UTC
README
官方Craft CMS + Commerce 插件
- 通过控制面板发送短信
- 通过服务发送短信
- 通过控制面板发送语音
- 通过服务发送语音
- 批量短信(仅Craft Commerce)
- 批量语音(仅Craft Commerce)
先决条件
- Craft CMS 3.1.5或更高版本
- 从seven获取API密钥
- (可选)Craft Commerce 2.x
安装
此插件可以通过Composer安装。
打开终端并执行以下命令
# navigate to your project root cd /var/www/craft # retrieve the plugin source code via Composer composer require seven.io/craft # install the plugin via Craft CLI ./craft install/plugin seven
设置
安装seven后,转到设置 → seven
,并输入您的API密钥。
使用方法
如何发送短信
use Seven\Craft\Plugin; // Use the plugin $instance = Plugin::getInstance(); // init plugin $sms = $instance->getSms(); // retrieve SMS service $sms->params // provides a fluent interface for method chaining ->setTo('+4901234567890, +456789012345') // required (recipient(s)) ->setText('HI2U!') // required (message) ->setFrom('Craft'); // optional (caller id) $sms->send(); // dispatch $voice = $instance->getVoice(); // retrieve Voice service $voice->params // provides a fluent interface for method chaining ->setTo('+4901234567890, +456789012345') // required (recipient(s)) ->setText('HI2U!') // required (message) ->setFrom('Craft'); // optional (caller id) $voice->send(); // dispatch
支持
需要帮助?请随时联系我们。