发送设置
方法概览
| 项目 | 内容 |
|---|---|
| 文档类型 | PHP 类方法 |
| 方法标识 | app\common\model\NoticeSettingModel::updateNoticeSetting |
| 所属业务 | 消息通知 |
| 来源模块/系统 | 通知发送管理 |
功能说明
发送设置
调用示例
$name = [['name' => '示例名称', 'sms_global_name' => 1, 'sms_global_template' => 1, 'sms_name' => '示例名称', 'sms_template' => 1, 'sms_enable' => 1, 'email_name' => 'user@example.com', 'email_template' => 1, 'email_enable' => 1]];
$configuration = [['send_sms' => 'string', 'send_sms_global' => 'string', 'send_email' => 'user@example.com']];
$result = (new \app\common\model\NoticeSettingModel())->updateNoticeSetting($name, $configuration);参数
| 参数 | 类型 | 必填 | 默认值 | 校验规则 | 说明 |
|---|---|---|---|---|---|
name | array | 是 | — | required | 动作名称为键 |
name.name | string | 是 | — | required | 动作名称 |
name.sms_global_name | int | 是 | — | required | 短信国际接口名称 |
name.sms_global_template | int | 是 | — | required | 短信国际接口模板id |
name.sms_name | string | 是 | — | required | 短信国内接口名称 |
name.sms_template | int | 是 | — | required | 短信国内接口模板id |
name.sms_enable | int | 是 | — | required | 启用状态,0禁用,1启用 |
name.email_name | string | 是 | — | required | 邮件接口名称 |
name.email_template | int | 是 | — | required | 邮件接口模板id |
name.email_enable | int | 是 | — | required | 启用状态,0禁用,1启用 |
configuration | array | 否 | — | — | 默认接口 |
configuration.send_sms | string | 否 | — | — | 默认国内短信接口 |
configuration.send_sms_global | string | 否 | — | — | 默认国际短信接口 |
configuration.send_email | string | 否 | — | — | 默认邮件接口 |
返回值
| 返回项 | 类型 | 说明 |
|---|---|---|
status | int | 状态码,200成功,400失败 |
msg | string | 提示信息 |
正常返回
{
"status": 1,
"msg": "string"
}异常情况
| 异常类型 | 说明 |
|---|---|
Throwable | 调用失败时由具体实现抛出异常,异常信息以运行时结果为准。 |