微信公众平台开发(102) 模版消息,102模版
关键字:微信公众平台 模版消息
作者:方倍工作室
原文:http://www.cnblogs.com/txw1958/p/wechat-template-message.html
在这篇微信公众平台开发教程中,我们将介绍如何开发模版消息,即如何用程序发送模版消息功能。
本文分为以下三个部分:
一、申请模版消息权限
模版消息的申请需账号已经开通微信支付权限。
在微信公众平台的后台,依次进入“功能->添加功能插件->模版消息”,即可申请模版消息。
调用SDK发送,代码如下
<span>1</span> <span>require_once</span>('weixin.class.php'<span>); </span><span>2</span> <span>$weixin</span> = <span>new</span><span> class_weixin(); </span><span>3</span> <span>var_dump</span>(<span>$weixin</span>->send_template_message(<span>urldecode</span>(json_encode(<span>$template</span>))));
实现效果如下如示:
四、代码下载
请关注方倍工作室微信公众账号,然后回复“下载模版”
============================================
方倍工作室微信公众平台账号关注方法:
1. 微信通讯录-添加朋友-查找公众号-搜索“方倍工作室”
2. 微信通讯录-添加朋友-搜号码-输入“pondbaystudio”
3. 使用微信扫描下面的二维码
$resultStr="
这些都是固定样式不支持自定义的。
给你个我代码里面用到的例子吧,具体里面字符串的话自己替换
希望您能采纳!谢谢

Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

AI Hentai Generator
Generate AI Hentai for free.

Hot Article

Hot Tools

mPDF
mPDF is a PHP library that can generate PDF files from UTF-8 encoded HTML. The original author, Ian Back, wrote mPDF to output PDF files "on the fly" from his website and handle different languages. It is slower than original scripts like HTML2FPDF and produces larger files when using Unicode fonts, but supports CSS styles etc. and has a lot of enhancements. Supports almost all languages, including RTL (Arabic and Hebrew) and CJK (Chinese, Japanese and Korean). Supports nested block-level elements (such as P, DIV),

SublimeText3 Linux new version
SublimeText3 Linux latest version

MantisBT
Mantis is an easy-to-deploy web-based defect tracking tool designed to aid in product defect tracking. It requires PHP, MySQL and a web server. Check out our demo and hosting services.

SublimeText3 Chinese version
Chinese version, very easy to use

Safe Exam Browser
Safe Exam Browser is a secure browser environment for taking online exams securely. This software turns any computer into a secure workstation. It controls access to any utility and prevents students from using unauthorized resources.