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