View Source WeChat.SubscribeMessage (wechat v0.12.0)
订阅信息
同时支持
Link to this section Summary
Types
类目ID
跳转网页时填写
开发者自行组合好的模板关键词列表
进入小程序查看”的语言类型
小程序 发送配置
跳转小程序类型
公众号 发送配置
个人模板id
服务场景描述
模板id
模板标题 id
Link to this section Types
@type category_id() :: String.t()
类目ID
@type jump_mini_program_object() :: %{ appid: WeChat.appid(), pagepath: WeChat.MiniProgram.Code.path() }
@type jump_page_url() :: String.t()
跳转网页时填写
@type kid_list() :: [String.t()]
开发者自行组合好的模板关键词列表
关键词顺序可以自由搭配(例如 [3,5,4] 或 [4,5,3]),最多支持5个,最少2个关键词组合
@type lang() :: String.t()
进入小程序查看”的语言类型
支持:
- 简体中文:
zh_CN
- 英文:
en_US
- 繁体中文:
zh_HK
- 繁体中文:
zh_TW
默认为: zh_CN
@type mini_program_send_options() :: %{ optional(:page) => WeChat.MiniProgram.Code.path(), optional(:miniprogram_state) => mini_program_state(), optional(:lang) => lang() }
小程序 发送配置
@type mini_program_state() :: String.t() | :developer | :trial | :formal
跳转小程序类型
- 开发版:
:developer
- 体验版:
:trial
- 正式版:
:formal
默认为: 正式版
@type official_account_send_options() :: %{ optional(:page) => jump_page_url(), optional(:miniprogram) => jump_mini_program_object() }
公众号 发送配置
page
和miniprogram
同时不填,无跳转;page
和miniprogram
同时填写,优先跳转小程序;
@type pri_tmpl_id() :: String.t()
个人模板id
@type scene_desc() :: String.t()
服务场景描述
15个字以内
@type send_data() :: map() | Keyword.t() | Enumerable.t()
@type send_options() :: official_account_send_options() | mini_program_send_options()
@type template_id() :: String.t()
模板id
@type tid() :: String.t()
模板标题 id
可通过接口获取,也可登录 公众号/小程序 后台查看获取
Link to this section Functions
@spec add_template(WeChat.client(), tid(), kid_list(), scene_desc()) :: WeChat.response()
组合模板并添加至帐号下的个人模板库 - 官方文档
@spec delete_template(WeChat.client(), pri_tmpl_id()) :: WeChat.response()
删除帐号下的个人模板 - 官方文档
@spec get_category(WeChat.client()) :: WeChat.response()
获取小程序账号的类目 - 官方文档
@spec get_pub_template_key_words_by_id(WeChat.client(), tid()) :: WeChat.response()
获取模板标题下的关键词列表 - 官方文档
@spec get_pub_template_titles( WeChat.client(), [category_id()], start :: non_neg_integer(), limit :: 1..30 ) :: WeChat.response()
获取帐号所属类目下的公共模板标题 - 官方文档
@spec get_templates(WeChat.client()) :: WeChat.response()
获取当前帐号下的个人模板列表 - 官方文档
@spec send( WeChat.client(), WeChat.openid(), template_id(), send_data(), send_options() ) :: WeChat.response()
发送订阅消息