创建动作
方法概览
| 项目 | 内容 |
|---|---|
| 文档类型 | PHP 类方法 |
| 方法标识 | common::notice_action_create |
| 所属业务 | 消息通知 |
| 来源模块/系统 | 公共函数 |
功能说明
创建动作
调用示例
$param = ['name' => '示例名称', 'name_lang' => '示例名称', 'type' => 'other', 'sms_name' => '示例名称', 'sms_template' => [['title' => '示例名称', 'content' => 'string']], 'sms_global_name' => '示例名称', 'sms_global_template' => [['title' => '示例名称', 'content' => 'string']], 'email_name' => 'user@example.com', 'email_template' => [['name' => 'user@example.com', 'title' => 'user@example.com', 'content' => 'user@example.com']]];
$result = notice_action_create($param);参数
| 参数 | 类型 | 必填 | 默认值 | 校验规则 | 说明 |
|---|---|---|---|---|---|
param.name | string | 是 | — | required | 动作英文标识 |
param.name_lang | string | 是 | — | required | 动作名称(在页面显示的名称) |
param.type | string | 否 | other | — | 通知分类(配置文件idcsmart.notice_setting_type中支持的,默认不传其他) |
param.sms_name | string | 否 | — | — | 短信接口标识名(可以为空,默认智简魔方短信接口) |
param.sms_template[].title | string | 是 | — | required | 短信模板标题 |
param.sms_template[].content | string | 是 | — | required | 短信模板内容 |
param.sms_global_name | string | 否 | — | — | 国际短信接口标识名(可以为空,默认智简魔方短信接口) |
param.sms_global_template[].title | string | 是 | — | required | 国际短信模板标题 |
param.sms_global_template[].content | string | 是 | — | required | 国际短信模板内容 |
param.email_name | string | 否 | — | — | 邮件接口名称(可以为空,默认SMTP接口) |
param.email_template[].name | string | 是 | — | required | 邮件模板名称 |
param.email_template[].title | string | 是 | — | required | 邮件模板标题 |
param.email_template[].content | string | 是 | — | required | 邮件模板内容 |
返回值
| 返回项 | 类型 | 说明 |
|---|---|---|
返回值 | mixed | — |
正常返回
{}异常情况
| 异常类型 | 说明 |
|---|---|
Throwable | 调用失败时由具体实现抛出异常,异常信息以运行时结果为准。 |