igniterlabs / ti-ext-smsnotify
向餐厅和顾客发送有关订单或预订的短信通知。
资助包维护!
tastyigniter
Open Collective
Requires
- arcturial/clickatell: ~3.0
- plivo/plivo-php: ^1.1
- twilio/sdk: ~6.0
- vonage/client: ^2.0
Replaces
- php-http/guzzle7-adapter: ~1.0
This package is auto-updated.
Last update: 2024-08-31 09:08:06 UTC
README
此扩展允许管理员在TastyIgniter发生特定事件时配置要发送的短信通知。
特性
- 每当有新订单下单时,接收短信通知
- 向您的客户发送有关他们的订单或预订状态的短信警报
- 可自定义的短信消息
- 支持渠道:twilio, nexmo, clickatell 和 plivo
- 添加您自己的自定义短信通知渠道。
管理员面板
转到 系统 > 设置 > 配置短信渠道 以管理通知渠道。可以通过导航到 设计 > 短信模板 在管理员面板中自定义通知消息。
使用 SendSmsNotification
自动化规则操作,在发生特定事件时发送通知,方法是在 工具 > 自动化 中进行导航。
用法
注册通知渠道和/或模板的示例
public function registerSmsNotifications()
{
return [
'channels' => [
'twilio' => \IgniterLabs\SmsNotify\Notifications\Channels\Twilio::class,
],
'template' => [
'igniterlabs.smsnotify::_sms.new_order' => 'igniterlabs.smsnotify::default.template.text_order_placed',
],
];
}
通知渠道类的示例
通知渠道类负责构建设置表单并设置所需的配置值。
class Twilio extends \IgniterLabs\SmsNotify\Classes\BaseChannel
{
/**
* Returns information about this channel, including name and description.
*/
public function channelDetails()
{
return [
'name' => 'Twilio SMS Channel',
'description' => '',
];
}
public function defineFormConfig()
{
return [
'status' => [
'label' => 'Status',
'type' => 'switch',
'default' => FALSE,
'span' => 'left',
'tab' => 'Twilio',
],
'account_sid' => [
'label' => 'Account SID',
'type' => 'text',
'tab' => 'Twilio',
],
...
];
}
public function send($to, $content)
{
//
}
}