WeChat Public Platform Development (102) template message, 102 template _php Tutorial

Source: Internet
Author: User

Public platform Development (102) template messages, 102 templates


Keywords: public platform template messages
Author: Fang Times studio
Original: http://www.cnblogs.com/txw1958/p/wechat-template-message.html

In this public platform development tutorial, we will show you how to develop a template message, that is, how to send a template message function using a program.
This article is divided into the following three sections:


I. Request template Message Permissions

Template message application requires account has been opened to pay permission.

In the background of the public platform, go to "function--add feature plug-in and template message", you can request template message.

Call the SDK to send the code as follows

1 require_once (' weixin.class.php '); 2 $weixin New class_weixin (); 3 Var_dump ($weixin->send_template_message (urldecode(Json_encode ($template)));

The implementation results are as follows:

Four, code download

Please pay attention to the double studio public account and then reply to "download template"

============================================

Double Studio public Platform account attention method:
1. Contacts-Add Friends-Find public number-search "double Studio"
2. Contacts-Add Friends-Search number-enter "Pondbaystudio"
3. Use the QR code below to scan


Public Platform Developer mode to reply to the text message code, to the full set of the best have words to explain

$RESULTSTR = " \ n <![CDATA[".$fromUsername."]]></tousername>\n <![CDATA[".$toUsername."]]></fromusername>\n ". Time ()." </createtime>\n news </msgtype>\n 1</articlecount>\n \ N <! [cdata["title"]]></title> \ n 详情请点击阅读全文</description>\n ".$picurl["roster_pic"]." </picurl>\n ".&#39;www.baidu.com&#39;." </url>\n </item>\n </articles>\n 0</funcflag>\n </xml> "; echo $resultStr; $resultStr = sprintf ($NEWSTPL, $fromUsername, $toUse Rname, Time (), $msgType, $title, $desription); look at you. $newstpl should be an already defined template, followed by the replacement parameters so you can see the template is correct
I'll give you an example of what I'm using in my code, and I'll replace it with the exact string.
I hope you can adopt! Thank you


Public platform reply whether the text message template can hide the date and change the default view-Full link

These are fixed styles that do not support customization.

http://www.bkjia.com/PHPjc/865480.html www.bkjia.com true http://www.bkjia.com/PHPjc/865480.html techarticle Public Platform Development (102) template message, 102 template keyword: Public platform template message Author: Fang Times Studio Original: Http://www.cnblogs.com/txw1958/p/wechat-templat ...

  • 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.