Documentation ¶
Index ¶
- func BizSendSubscribe(accessToken string, msg *SubscribeMessage) error
- func CmdMpBizSendSubscribe(arg *CmdMpBizSendSubscribeParams) error
- func CmdMpSendTemplate(arg *CmdMpSendTemplateParams) error
- func CmdMpSendTemplateSubscribe(arg *CmdMpSendTemplateSubscribeParams) error
- func SendTemplate(accessToken string, msg *TemplateMessage) (int64, error)
- func SendTemplateSubscribe(accessToken string, msg *TemplateSubscribeMessage) error
- type CmdMpBizSendSubscribeParams
- type CmdMpSendTemplateParams
- type CmdMpSendTemplateSubscribeParams
- type MiniProgramMeta
- type SubscribeDataItem
- type SubscribeMessage
- type TemplateDataItem
- type TemplateMessage
- type TemplateMessageResponse
- type TemplateSubscribeMessage
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func BizSendSubscribe ¶
func BizSendSubscribe(accessToken string, msg *SubscribeMessage) error
BizSendSubscribe 发送微信公众号订阅通知消息
func CmdMpBizSendSubscribe ¶
func CmdMpBizSendSubscribe(arg *CmdMpBizSendSubscribeParams) error
CmdMpBizSendSubscribe 发送微信公众号订阅通知消息
func CmdMpSendTemplate ¶
func CmdMpSendTemplate(arg *CmdMpSendTemplateParams) error
CmdMpSendTemplate 发送微信公众号模板消息
func CmdMpSendTemplateSubscribe ¶
func CmdMpSendTemplateSubscribe(arg *CmdMpSendTemplateSubscribeParams) error
CmdMpSendTemplateSubscribe 发送微信公众号一次性订阅消息
func SendTemplate ¶
func SendTemplate(accessToken string, msg *TemplateMessage) (int64, error)
SendTemplate 发送微信公众号模板消息
func SendTemplateSubscribe ¶
func SendTemplateSubscribe(accessToken string, msg *TemplateSubscribeMessage) error
SendTemplateSubscribe 发送微信公众号一次性订阅消息
Types ¶
type CmdMpBizSendSubscribeParams ¶
type CmdMpBizSendSubscribeParams struct { UserAgent string AccessToken string AppID string AppSecret string ToUser string TemplateID string Page string Mini map[string]string Data string }
func (*CmdMpBizSendSubscribeParams) Validate ¶
func (t *CmdMpBizSendSubscribeParams) Validate() error
type CmdMpSendTemplateParams ¶
type CmdMpSendTemplateParams struct { UserAgent string AccessToken string AppID string AppSecret string ToUser string TemplateID string Url string Mini map[string]string Color string ClientMsgID string Data string }
func (*CmdMpSendTemplateParams) Validate ¶
func (t *CmdMpSendTemplateParams) Validate() error
type CmdMpSendTemplateSubscribeParams ¶
type CmdMpSendTemplateSubscribeParams struct { UserAgent string AccessToken string AppID string AppSecret string ToUser string TemplateID string Url string Mini map[string]string Scene string Title string Data string }
func (*CmdMpSendTemplateSubscribeParams) Validate ¶
func (t *CmdMpSendTemplateSubscribeParams) Validate() error
type MiniProgramMeta ¶
type MiniProgramMeta struct { AppID string `json:"appid"` // 所需跳转到的小程序appid(该小程序 appid 必须与发模板消息的公众号是绑定关联关系,暂不支持小游戏) PagePath string `json:"pagepath"` // 所需跳转到小程序的具体页面路径,支持带参数,(示例index?foo=bar),要求该小程序已发布,暂不支持小游戏 }
MiniProgramMeta 跳小程序所需数据
type SubscribeDataItem ¶
type SubscribeDataItem struct {
Value string `json:"value"`
}
SubscribeDataItem 模板变量值
type SubscribeMessage ¶
type SubscribeMessage struct { ToUser string `json:"touser"` TemplateID string `json:"template_id"` Page string `json:"page,omitempty"` MiniProgram *MiniProgramMeta `json:"miniprogram,omitempty"` // 可选, 跳小程序所需数据,不需跳小程序可不用传该数据 Data map[string]SubscribeDataItem `json:"data"` }
SubscribeMessage 微信公众号订阅通知消息
type TemplateDataItem ¶
type TemplateDataItem struct { Value string `json:"value"` // 必选, 模板内容 Color string `json:"color,omitempty"` // 可选, 模板内容字体颜色,不填默认为黑色 }
TemplateDataItem 模板变量值, 模版内某个 .DATA 的值
type TemplateMessage ¶
type TemplateMessage struct { ClientMsgID string `json:"client_msg_id,omitempty"` // 可选, 防重入id。对于同一个openid + client_msg_id, 只发送一条消息,10分钟有效,超过10分钟不保证效果。若无防重入需求,可不填 ToUser string `json:"touser"` // 必须, 接受者OpenID TemplateID string `json:"template_id"` // 必须, 模版ID URL string `json:"url,omitempty"` // 可选, 用户点击后跳转的URL, 该URL必须处于开发者在公众平台网站中设置的域中 MiniProgram *MiniProgramMeta `json:"miniprogram,omitempty"` // 可选, 跳小程序所需数据,不需跳小程序可不用传该数据 Data map[string]TemplateDataItem `json:"data"` // 必须, 模板数据, JSON 格式的 []byte, 满足特定的模板需求 Color string `json:"color,omitempty"` // 可选, 模板内容字体颜色,不填默认为黑色 }
TemplateMessage 微信公众号模板消息
type TemplateMessageResponse ¶
type TemplateMessageResponse struct { weixin.ResponseMeta MsgID int64 `json:"msgid,omitempty"` // 消息id }
TemplateMessageResponse 模板消息的响应
func (TemplateMessageResponse) String ¶
func (t TemplateMessageResponse) String() string
type TemplateSubscribeMessage ¶
type TemplateSubscribeMessage struct { ToUser string `json:"touser"` // 必须, 接受者OpenID TemplateID string `json:"template_id"` // 必须, 模版ID Scene string `json:"scene"` // 订阅场景值 Title string `json:"title"` // 消息标题,15字以内 URL string `json:"url,omitempty"` // 可选, 用户点击后跳转的URL, 该URL必须处于开发者在公众平台网站中设置的域中 MiniProgram *MiniProgramMeta `json:"miniprogram,omitempty"` // 可选, 跳小程序所需数据,不需跳小程序可不用传该数据 Data map[string]TemplateDataItem `json:"data"` // 必须, 模板数据, JSON 格式的 []byte, 满足特定的模板需求 }
TemplateSubscribeMessage 微信公众号一次性订阅消息
Click to show internal directories.
Click to hide internal directories.