Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

Example Analysis of sending template message in WeChat Mini Programs

2025-01-17 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

Shulou(Shulou.com)06/03 Report--

This article mainly introduces the example analysis of sending template messages in WeChat Mini Programs, which has a certain reference value. Interested friends can refer to it. I hope you will gain a lot after reading this article. Let the editor take you to know it.

Send template message in WeChat Mini Programs

Refer to Wechat public platform Api document address: https://mp.weixin.qq.com/debug/wxadoc/dev/api/notice.html# template message management

The implementation logic is divided into:

1. Get access_token

2. Send template messages (including user's openid, template's template_id, user-triggered form form_id or payment's pre-prepay_id)

Note:

1. The user's openid is obtained through user authorization.

2. The template_id of the template is viewed from the "template message" of the public platform of Mini programs.

3. The from_id of the form is obtained from the report-submit= "true" in the form submission event triggered by the user. If the user payment message is sent, the value can be the pre-pay _ id that places the order payment.

Error return code Note: errcode:41028,errmsg: "invalid form id hint: [YVJBEA0597ge21]"

There are several situations in which this error is reported:

1. If it is found that the value of form_id is "the formId is a mock one", it means that it is not tested on the real machine, but needs to be tested on the real machine.

2. The user who triggered the confirmation event is not the same as the user who sent the message.

3. The prepaid user is not the same as the user who sent the message.

Experience: the collection notice was found in the template message of Wechat public platform, thinking that the user triggered the payment and can send the receipt notice to the merchant. But I kept reporting this error, and only later found out that Wechat did not allow it.

Thank you for reading this article carefully. I hope the article "sample Analysis of sending template messages in WeChat Mini Programs" shared by the editor will be helpful to everyone. At the same time, I also hope that you will support and pay attention to the industry information channel. More related knowledge is waiting for you to learn!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Development

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report