LaneWeChat

PHP微信开发框架,高效开发微信公众号应用。简洁而又轻量

GitHub下载 查看手册

推送的模板消息

Visits: 10412 Date: 2014-11-05 15:04:38 Power By 李轩Lane

    

            场景描述:公众号推送的模板消息,比如领取红包、滴滴打车红包领取、大众点评微信支付等


            场景举例:我们在实体店的一家服装店买了新衣服,而我们又是会员,他们检测到会员的手机号消费了,有新积分增加,而这个手机号又关注了这家服装店的微信公众号,根据手机号可以在服装店自己的数据库中查到微信粉丝openId,这个时候就会给这个用户发送一个模板消息。


            代码:

            <?php 

            include 'lanewechat.php';


                $data = array(

                       'first'=>array('value'=>'您好,您已成功消费。', 'color'=>'#0A0A0A')

                       'keynote1'=>array('value'=>'巧克力', 'color'=>'#CCCCCC')

                       'keynote2'=>array('value'=>'39.8元', 'color'=>'#CCCCCC')

                       'keynote3'=>array('value'=>'2014年9月16日', 'color'=>'#CCCCCC')

                       'keynote3'=>array('value'=>'欢迎再次购买。', 'color'=>'#173177')

                );

            


                //$touser 接收方的OpenId。

                //$templateId 模板Id。在公众平台线上模板库中选用模板获得ID

                //$url URL 点击查看的时候跳转到URL。

                //$topcolor 顶部颜色,可以为空。默认是红色


            \LaneWeChat\Core\TemplateMessage::sendTemplateMessage($data, $touser, $templateId, $url, $topcolor='#FF0000');



Reply: miyaye On 2016-02-18 14:38:16

推送模版消息 为什么调用之后 会发多次给用户呢

回复

Reply: Hellmessage On 2016-09-04 16:42:55

如何调取用户openid

回复

Reply: ehuaxizb On 2020-01-25 00:01:36

http://mewkid.net/who-is-xandra/ - Amoxicillin Online <a href="http://mewkid.net/who-is-xandra/">Amoxicillin No Prescription</a> uvt.hpcy.lanewechat.lanecn.com.apf.md http://mewkid.net/who-is-xandra/

回复

Reply: iguyocole On 2020-01-25 00:15:05

http://mewkid.net/who-is-xandra/ - Amoxicillin <a href="http://mewkid.net/who-is-xandra/">Amoxicillin 500 Mg</a> xvr.nhru.lanewechat.lanecn.com.erf.fh http://mewkid.net/who-is-xandra/

回复

Reply: ehuxisa On 2020-01-25 07:17:01

http://mewkid.net/who-is-xandra/ - Amoxicillin 500mg Capsules <a href="http://mewkid.net/who-is-xandra/">Amoxicillin 500 Mg Dosage</a> sbv.gxgo.lanewechat.lanecn.com.uyr.xp http://mewkid.net/who-is-xandra/

回复

Reply: habiuzesimo On 2020-01-25 07:30:29

http://mewkid.net/who-is-xandra/ - Amoxicillin 500 Mg <a href="http://mewkid.net/who-is-xandra/">Amoxicillin 500mg Capsules</a> cbc.hlqp.lanewechat.lanecn.com.rxg.yy http://mewkid.net/who-is-xandra/

回复

Reply: ozoyiqegiocop On 2020-01-25 07:47:08

http://mewkid.net/who-is-xandra/ - Amoxicillin 500mg <a href="http://mewkid.net/who-is-xandra/">Buy Amoxicillin Online</a> sau.nhjj.lanewechat.lanecn.com.etq.ov http://mewkid.net/who-is-xandra/

回复

Reply: evahakuwa On 2020-01-25 08:39:14

http://mewkid.net/who-is-xandra/ - Amoxicillin 500mg <a href="http://mewkid.net/who-is-xandra/">Amoxicillin 500mg Capsules</a> wmj.ntdy.lanewechat.lanecn.com.dww.be http://mewkid.net/who-is-xandra/

回复

Reply: Elltherie On 2020-03-07 21:46:21

Cancer Clomid http://apcialisle.com/# - online cialis Propecia Liver Damage <a href=http://apcialisle.com/#>tadalafil cialis from india</a> Was Ist Levitra Pde 5 Hemmer

回复

Reply: Elltherie On 2020-03-17 00:44:52

Cialis En Capital Federal http://apcialisle.com/# - Cialis Cheap Celebrex Online <a href=http://apcialisle.com/#>Buy Cialis</a> Amoxicillin Dosage For Infant

回复

Reply: Elltherie On 2020-03-24 00:34:19

Biaxin With No Prescription https://apcialisle.com/# - Cialis Comprar Cialis Opiniones <a href=https://apcialisle.com/#>Cialis</a> Trusted Tablets Viagra

回复

Reply: Vastherie On 2020-05-01 03:40:36

Diferencias Entre Cialis Y Levitra https://cheapcialisir.com/# - Cialis Baclofene Arret Tabac <a href=https://cheapcialisir.com/#>Cialis</a> How To Buy Stendra Ed Medication Website

回复

Add Comment
©2014 lanewechat.lanecn.com , All rights reserved. Power By LaneWeChat 微信PHP开发框架.  京ICP备14005030号