Notes for sending template messages in WeChat applets, mini-program templates

Source: Internet
Author: User
Tags openid

Precautions for sending template messages in the applet, And the applet Template

Send template messages in the Applet

For more information, see the public platform Api documentation at https://mp.weixin.qq.com/debug/wxadoc/dev/api/notice.html#model-based message management.

This reference address is detailed and detailed.

The implementation logic is divided:

1. Get access_token

2. Send the template message (including the user's openid, template_id of the template, the user-triggered form form_id or the pre-prepay_id of the Payment)

Note:

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

2. view the template_id of the template on the "template message" of the mini-program public platform.

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 sent user pays the message, the value can be the pre-prepay_id of the order payment.

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

This error is reported in several cases:

1. If the value of form_id is "the formId is a mock one", it indicates that it is not tested on a real machine and must be tested on a real machine.

2. the user who triggered the event and the user who sent the message are not the same person

3. The pre-payment user and the user who sent the message are not the same person

 

TIPS: A collection notification is found in the template message on the public platform, so that the user can send a collection notification to the merchant when the payment is triggered. However, this error was reported until it was discovered that this error was not allowed.

However, you can only send receipt notifications, but what is the purpose? If you have any good solutions, please leave a message and let me know.

 

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.