Joke Collection Website - Public benefit messages - How does php write message push on WeChat public platform?
How does php write message push on WeChat public platform?
/**
*? Send template message
*? @param? $tmpId? Template ID
*? @param? $openId? User openID
*? @param? $param? Template parameters
*? @param? $url
*? @ Return? compound
*? @ Author? fjlhuman
*/
Public? Function? sendtpmessage($ tmpId,$openId,$param,$url){
$postUrl? =? "/cgi-bin/message/template/send? Access token = ". $ this-& gt; accessToken
$ arr data[' touser ']= $ openId;
$ arr data[' template _ id ']= $ tmpId; //' 6 ot 8 ddnf-cbiadtsbekskczvhe _ 9 hnhxobt 7 evurnce ';
$ arr data[' URL ']= $ URL;
$ arr data[' data ']= $ param;
$ JSON = JSON _ encode($ arr data);
$ Results? =? Curl::post($postUrl,? $ JSON);
$result=json_decode($result,? True);
$ rData[' isTure ']= false;
$ rData[' msg ']= " ";
if($result['errcode']==0){
$ rData[' isTure ']= true;
$rData['msg']= "Sending succeeded";
} Otherwise {
$ rData[' msg ']= $ result[' errcode '];
}
Return? $ rData
} For details, please refer to? Technical documents of wechat public platform->; Template message interface?
- Previous article:Telecom SMS Interception Charge 30 yuan
- Next article:Positive energy of popular sentences
- Related articles
- Talk about snow and sadness
- What does it mean to dream of being drunk? Dream of being drunk, okay?
- How do enterprises open electronic invoices?
- How to reply to thank-you messages from colleagues?
- Weizhong Bank said it would freeze my bank card. Really?
- Apple's mobile phone can't send text messages, and the tips are not sent.
- Cantonese New Year songs! ! !
- Why can't Unicom receive and send short messages?
- Excuse me: the imperial city of mortals, the city of people in the long years. Where does this sentence come from?
- What does it mean when a friend asked me to send a message from nu01 to 1069070037?