The content of this article is about the method (code) of php implementing WeChat applet to send template messages. It has certain reference value. Friends in need can refer to it. I hope it will be helpful to you.
The WeChat address is:
1 |
|
The relevant parameters are
##parametersRequiredillustratetouseryesThe openid of the recipient (user)template_idyesThe id of the template message to be deliveredpagenoThe jump page after clicking the template card is limited to pages within this mini program. Supports parameters, (example index?foo=bar). If this field is not filled in, the template will not jump. form_idyesIn the form submission scenario, it is the formId brought by the submit event; in the payment scenario, it is the prepay_id of this paymentdatayesTemplate content, if not filled in, an empty template will be issuedcolornoThe color of the font of the template content. If not filled in, the default is black [Abandoned]emphasis_keywordnoKeywords that need to be amplified in the template. If not filled in, the amplification will be disabled by defaultFirst Pitfall: The form_id obtained by the computer cannot be used
The second pitfall: the form_id needs to be obtained from the real phone, but the real phone must also be online. For projects on, if the local test is not launched online, you will be prompted to verify the form_id. WeChat does not explain this point of attention, that is, it needs to be tested online after the review is successfully released.
Next let’s talk about the back-end code1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 |
|
php method to implement sending WeChat template message, php letter template message
PHP WeChat development template message reply, php template message reply_PHP tutorial
The above is the detailed content of PHP implements the method of sending template messages in WeChat applet (code). For more information, please follow other related articles on the PHP Chinese website!