LaneWeChat

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

GitHub下载 查看手册

被动响应用户 - 发送图文消息

Visits: 21828 Date: 2014-11-05 14:39:05 Power By 李轩Lane

    

            场景描述:用户给我们的公众号发送了一条消息,我们的公众号被动响应,给用户回复一条图文消息。


            场景举例:用户给我们的公众号发送了“周末聚会”,我们的公众号给用户回复了一条图文消息,有十条,每一条都是一个标题和图片,点击可以连接到一个地址。


            代码:

            <?php 

            include 'lanewechat.php';


            use LaneWeChat\Core\ResponsePassive;


            //图文列表逐条放入数组

            $tuwenList = array();

            $tuwenList[] = array(

                'title' => '标题:聚会地点一故宫',

                'description' => '描述:还有人去故宫聚会啊',

                'pic_url' => 'http://www.gugong.com/logo.jpg',

                'url' => 'http://www.lanecn.com/',

            );

            $tuwenList[] = array(

                'title' => '标题:聚会地点一八达岭',

                'description' => '描述:八达岭是聚会的吗?是去看人挤人的!',

                'pic_url' => 'http://www.badaling.com/logo.jpg',

                'url' => 'http://www.lanecn.com/',

            );

            $item = array();

            //构建图文列表

            foreach($tuwenList as $tuwen){

                $item[] = ResponsePassive::newsItem($tuwen['title'], $tuwen['description'], $tuwen['pic_url'], $tuwen['url']);

            }

            //发送图文列表

            ResponsePassive::news($request['fromusername'], $request['tousername'], $item);

Reply: laoq On 2015-07-04 10:41:49

lane: 是不是考虑加一个获取openid的函数?,很多时候需要这个openID,示例中只有通过网页授权才获取到opendi,查询过资料,普通订阅号是不具备网页授权功能,所以需要另外的途径获取openid,查询过资料,有两个不同的Access Token,他们产生的方式不一样,一种是使用AppID和AppSecret获取的access_token,一种是OAuth2.0授权中产生的access_token,通过这两种都可以获取到openid

回复

Reply: sywee On 2016-01-08 19:14:17

到他微博给他发消息,他应该会很快看到的

回复

Reply: adu On 2015-08-18 14:44:40

这个怎么使用啊??

回复

Reply: Michael On 2015-11-14 19:06:30

真的不错!自己可以写php微信平台了

回复

Reply: freshman On 2016-02-15 01:23:45

这个代码要放在哪个地方。。。。 弄了半天也没弄对,希望能得到你的解答!

回复

Reply: test On 2016-05-18 13:37:19

怎么获取用户发送过来的信息,比如“周末聚会”

回复

Reply: 葱头 On 2016-08-26 21:31:15

用户发来的信息储存在这个变量中$request['content'] 可以通过修改 Core/wechatrequest.lib.php 如下 $content = $request['content']; return ResponsePassive::text($request['fromusername'], $request['tousername'], $content); 效果是你发送什么信息 公众号回复什么信息

回复

Reply: wwrawbarseie On 2021-10-15 15:22:22

pharmacie etampes pharmacie bailly vente en ligne , pharmacie galerie auchan illkirch pharmacie avenue jean dalmas aix en provence , Achat Prednisolone 20 mg bon marchГ©, Prednisolone prix Suisse. Achat Prednisolone 20 mg bon marchГ© Prednisolone 20 mg acheter <a href=https://www.nace.org/network/members/profile?UserKey=645a866a-d0b0-47c0-b653-23536cd6ac1a#>Achat Prednisolone 20 mg bon marchГ©</a> therapies manuelles et energetiques Ciprofloxacine livraison rapide, Ciprofloxacine sans ordonnance en ligne. Ciprofloxacine France sans ordonnance Ciprofloxacine 1000 mg acheter <a href=https://www.nace.org/network/members/profile?UserKey=596c3ef1-e4d9-40d8-bda3-82a98add768a#>Achat Ciprofloxacine 1000 mg bon marchГ©, Ciprofloxacine livraison rapide</a> , therapies humanistes definition traitement otite , parapharmacie leclerc juvamine. pharmacie ouverte dimanche 91 therapies for schizophrenia Furosemide Canada sans ordonnance, Furosemide prix Canada. Furosemide Canada sans ordonnance Furosemide comprimГ© acheter <a href=https://www.nace.org/network/members/profile?UserKey=197d2b3f-273e-4a1c-a5be-237ed4dfa41d#>Furosemide Lasilix comprimГ©</a> , pharmacie hyeres. therapie cognitivo-comportementale guides de pratiques et autres outils, pharmacie test amiens pharmacie angers ney . pharmacie de garde beauvais oise, pharmacie argenteuil val medicaments ulcere medicaments weleda .

回复

Reply: PEteryweTdo On 2021-11-18 16:57:54

pharmacie leclerc le relecq kerhuon pharmacie de.garde marseille , pharmacie zola pharmacie annecy garde Orlistat livraison rapide, Orlistat vente libre en ligne. Achat Orlistat bon marchГ© Acheter Orlistat en pharmacie <a href=https://www.moe.gov.tt/question/orlistat-sans-ordonnance-france/#>Orlistat sans ordonnance France, Orlistat livraison rapide</a> , pharmacie guynemer amiens <a href=http://newww.gr/act/full-day-landrover-safari-from-heraklion-with-meals/>environments free of microorganisms are known as es</a> ea28559 , pharmacie argenteuil gabriel peri pharmacie de garde rueil , pharmacie lafayette wikipedia. therapies psychomotrices , pharmacie rue saint pierre beauvais Acheter Fluoxetine en pharmacie, Fluoxetine vente libre en ligne. Fluoxetine sans ordonnance Belgique Acheter Fluoxetine en pharmacie <a href=https://www.moe.gov.tt/question/fluoxetine-sans-ordonnance-belgique/#>Fluoxetine sans ordonnance Belgique</a> therapies of adhd . pharmacie ouverte orange, pharmacie fauquet amiens Priligy sans ordonnance France, Priligy prix France. Achat Priligy bon marchГ© Acheter Priligy en pharmacie <a href=https://www.moe.gov.tt/question/priligy-prix-france/#>Achat Priligy bon marchГ©</a> pharmacie leclerc saumur .

回复

Reply: Julian On 2021-11-21 12:06:28

Fascinating blog! Is your theme custom made or did you download it from somewhere? A theme like yours with a few simple tweeks would really make my blog shine. Please let me know where you got your theme. With thanks My research works https://importantinfluencesessay.blogspot.com/2021/11/argumental-essay.html My research works https://educationessay2.blogspot.com/2021/11/how-do-i-write-research-paper.html

回复

Reply: Kimberly On 2021-12-17 20:59:37

порно мамки

回复

Reply: PEteryweTrr On 2022-01-17 06:37:30

pharmacie annecy le vieux horaires pharmacie l'unite aix en provence Prednisolon kaufen Г¶sterreich, Prednisolon ohne rezept Г¶sterreich. Gunstig online Prednisolon kaufen Prednisolon kaufen ohne rezept Г¶sterreich <a href=https://nanohub.org/projects/prednisolonerezept#>Prednisolon Prednisolone 20 mg</a> therapie quantique avis pharmacie de garde juvisy , pharmacie de garde aujourd'hui coutras <a href=http://newww.gr/act/full-day-landrover-safari-from-heraklion-with-meals/>galveston county community action council rosenberg tx good</a> 979f89c , pharmacie de garde aujourd'hui carcassonne pharmacie lafayette quimper , therapies breves angers. therapies eating disorders Tamoxifen generika kaufen rezeptfrei Г¶sterreich, Tamoxifen generika kaufen rezeptfrei Г¶sterreich. Tamoxifen gunstig bestellen Gunstige Tamoxifen ohne versandkosten <a href=https://nanohub.org/projects/tamoxifen48#>Tamoxifen Tamoxifene 20 mg</a> , pharmacie gare angers saint laud therapies numeriques . pharmacie de garde, traitement bronchite pharmacie drive avignon .

回复

Reply: PEteryweTdw On 2022-01-19 03:00:47

therapie genique avantages inconvenients pharmacie boulogne billancourt avenue victor hugo <a href=https://www.librarything.com/profile/DavidLoos>Achat Xenical bon marche</a> pharmacie ouverte paris pharmacie avenue jean dalmas aix en provence pharmacie rue victor eusen brest pharmacie la bailly rue albert camus salouГ«l pharmacie rue jean jaures argenteuil .

回复

Reply: ClhOZ On 2022-02-02 02:09:32

<a href="https://seroquel4all.top">where to buy seroquel</a>

回复

Reply: Maira On 2022-02-11 10:25:47

порно мамки

回复

Reply: Virgie On 2022-02-14 03:09:32

Howdy outstanding website! Does running a blog such as this take a large amount of work? I've no knowledge of programming but I had been hoping to start my own blog in the near future. Anyway, should you have any recommendations or tips for new blog owners please share. I know this is off subject but I simply had to ask. Appreciate it! comment avoir son propre code promo 1xbet

回复

Reply: Gregory On 2022-02-15 14:55:27

Currently it appears like Movable Type is the top blogging platform out there right now. (from what I've read) Is that what you are using on your blog? 1хбет промокод день рождения

回复

Reply: Glenn On 2022-03-05 22:58:26

What's up mates, how is everything, and what you want to say concerning this piece of writing, in my view its truly remarkable for me. 1xbet promo code for today for free how to get 2022 (http://mjvids.co.uk/skins/elm/1xbet-promo-code-for-india_5.html)

回复

Reply: Nichol On 2022-03-11 15:50:51

Pretty nice post. I just stumbled upon your blog and wished to say that I have truly enjoyed browsing your blog posts. After all I'll be subscribing to your rss feed and I hope you write again soon! where buy prednisone tablets

回复

Reply: Nell On 2022-05-06 04:05:42

Найкращі фільми 2021 link

回复

Reply: Forest On 2022-06-26 04:26:31

вот этот

回复

Reply: Consuelo On 2022-07-15 04:30:44

магазин руторг

回复

Reply: Hiram On 2022-07-26 16:49:14

Кровь машин смотреть фильмы онлайн

回复

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