package
Version:
v0.10.3
Opens a new window with list of versions in this module.
Published: Aug 22, 2023
License: MIT
Opens a new window with license information.
Imports: 0
Opens a new window with list of imports.
Imported by: 0
Opens a new window with list of known importers.
README
¶
Message Sender约束
一般原则:
同一组织,同一发送平台下保留一个发送账号生效,采用优先级原则。
ORG -> APP_ID -> CATEGORY -> SENDER
组织1, App1, 短信, 默认1
- 如果对接多个平台,按照账号优先级,总是有一个生效,依照具体算法排序
- API在调用时不再提供sender_id。 template id依旧需要明确在参数中。
sms:
Sender组成:
app_key, app_secret, sign_name
- 现在不是SaaS模式,因此一个组织下,理论上每个短信平台允许存在一个SMS发送账号。
- 一个组织下设置一个默认发送账号
- 模板不维护签名等信息(如同一发送平台设置多个签名,需要创建多个sender)
sms签名优先级: api参数 > 模板配置 > sender配置
- 请求参数如果带有签名优先使用
- 如请求中不带签名值,会在模板中查找签名
- 如模板中未设置签名,会使用sender中的签名
Documentation
¶
type MailRequest struct {
Subject string `json:"subject,omitempty"`
TextContent string `json:"textContent,omitempty"`
Receivers []string `json:"receivers,omitempty"`
Template string `json:"template,omitempty"`
Params map[string]interface{} `json:"params,omitempty"`
}
type Message struct {
MessageId int `json:"id"`
MessageCategory int `json:"messageCategory,omitempty"`
}
Message 消息
type Payload struct {
MessageCategory int `json:"messageCategory,omitempty"`
Sender string `json:"sender"`
Payload interface{} `json:"payload"`
}
type Response struct {
RequestId string
Payload interface{}
}
Response 服务器回复
Source Files
¶
Directories
¶
Click to show internal directories.
Click to hide internal directories.