C#推送微信公众号模版消息

1. 需要在微信公众号申请模版消息,选择你的行业范围

2.【模版消息】—— 【模版库】

    可以搜索你想要的模版,也可以申请需要的模版。

3. 点击详情:添加到我的模板

4. 我的模板 :复制模板ID

 

5.  C#后台代码推送消息

 public static string send_equipment(string openid, string name)
        {
            string data = "{\"touser\":\"" + openid + "\",\"template_id\":\" 模板ID\",\"url\":\"\",\"topcolor\":\"#FF0000\",\"data\":{\"first\": {\"value\":\"您好\"},\"name\":{\"value\":\"" + name + "\"},\"remark\":{\"value\":\"" + DateTime.Now + "    感谢您的支持!\"}}}";
            return ModelMessageSend(data);
        }

猜你喜欢

转载自blog.csdn.net/LYfrighting/article/details/81976627