2017 © Pedro Peláez
 

library wechat-notice

Wechat notice

image

hanson/wechat-notice

Wechat notice

  • Thursday, February 16, 2017
  • by hanson
  • Repository
  • 1 Watchers
  • 18 Stars
  • 119 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 6 Forks
  • 0 Open issues
  • 2 Versions
  • 3 % Grown

The README.md

wechat-notice

wechat-notcie 是基于 laravel 和 EasyWechat 开发的微信消息模板通知功能, (*1)

安装

composer require hanson/wechat-notice

添加 Hanson\WechatNotice\NoticeServiceProvider::classapp.phpproviders 中, (*2)

使用

config

当不做任何设置时,Notice会自动读取 config('services.wechat') 的配置, (*3)

\WechatNotice::send($openId, $templateId, [
    'first' => '系统异常',
    'keyword1' => '',
    'keyword2' => '',
    'keyword3' => '',
    'remark' => '请及时处理'
]);

已存在实例

$wechat = new Application([
    'app_id'  => $appId,
    'secret'  => $secret,
]);

\WechatNotice::setWechat($wechat)->send($openId, $templateId, [
    'first' => '系统异常',
    'keyword1' => '',
    'keyword2' => '',
    'keyword3' => '',
    'remark' => '请及时处理'
], null, '#af0505');

直接设置配置

\WechatNotice::setConfig([
    'app_id'  => $appId,
    'secret'  => $secret,
])->send($openId, $templateId, [
    'first' => '系统异常',
    'keyword1' => '',
    'keyword2' => '',
    'keyword3' => '',
    'remark' => '请及时处理'
]);

发送给多个用户

\WechatNotice::send([$openId, $openId2, $openId3, ...], $templateId, [
    'first' => '系统异常',
    'keyword1' => '',
    'keyword2' => '',
    'keyword3' => '',
    'remark' => '请及时处理'
]);

The Versions

16/02 2017

dev-master

9999999-dev

Wechat notice

  Sources   Download

The Requires

 

The Development Requires

by Avatar hanson

16/02 2017

v1.0.0

1.0.0.0

Wechat notice

  Sources   Download

The Requires

 

The Development Requires

by Avatar hanson