承接 jundayw/message 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

jundayw/message

最新稳定版本:v0.1.0

Composer 安装命令:

composer require jundayw/message

包简介

Integrates with SMS, DingTalk, and WeChat through a single API, and supports customizable channels.

README 文档

README

Message

Integrates with SMS, DingTalk, and WeChat through a single API, and supports customizable channels.

GitHub Tag Total Downloads Packagist Version Packagist PHP Version Support Packagist License

Table of Contents
  1. Installation
  2. Usage
  3. Contributing
  4. Contributors
  5. License

Installation

You can install the package via Composer:

composer require jundayw/message

[back to top]

Usage

SMS

method send: specify templateCode, templateParam, and signName explicitly (with a placeholder signName that gets

Message::channel('sms')->send(['136****5922'], [
    'templateCode'  => 'SMS_275***212',
    'templateParam' => [
        'code' => 123454,
    ],
    'signName'      => '${signName}',
], [
    'signName' => 'aliyun',
]);

Custom template sending:

uses a logical template name (e.g., 'demo') instead of the provider's template code

Message::channel('sms')->sendTemplate(['136****5922'], 'demo', [
    'code' => 234567,
]);

Service provider template number:

directly uses the provider's official template code (e.g., 'SMS_275***212')

Message::channel('sms')->sendTemplate(['136****5922'], 'SMS_275***212', [
    'code' => 345678,
]);

DingTalk

$message = Message::channel('dingtalk_robot')->send(['136****5922'], [
    'msgtype' => 'text',
    'text'    => [
        'content' => 'message.dingtalk_robot.send',
    ],
]);

Custom template sending:

return [
    'channels' => [
        'dingtalk_robot' => [
            'webhook'   => env('DINGTALK_ROBOT_WEBHOOK'),
            'secret'    => env('DINGTALK_ROBOT_SECRET'),
            'templates' => [
                'demo' => [
                    'msgtype' => 'text',
                    'text'    => [
                        'content' => '${content}',
                    ],
                ],
            ],
        ],
    ],
];
$message = Message::channel('dingtalk_robot')->sendTemplate(['136****5922'], 'demo', [], [
    'content' => 'message.dingtalk_robot.send',
    'at_all'  => true,
]);
$message = Message::channel('dingtalk_robot')->sendTemplate(['136****5922'], 'text', [
    'text' => [
        'content' => 'message.dingtalk_robot.send',
    ],
]);

WeChat

WechatMiniProgram

$message = Message::channel('wechat_mini_program')->send(['oDx1b*****C3o0'], [
    'template_id' => '1pNJGVRYV***ozu1AJKUlbGQ',
    'page'        => 'index',
    'data'        => [
        'thing1' => ['value' => '验证码'],
        'thing2' => ['value' => '登录验证'],
    ],
]);
$message = Message::channel('wechat_mini_program')->sendTemplate(['oDx1b*****C3o0'], '1pNJGVRYV***ozu1AJKUlbGQ', [
    'page' => '${page}',
    'data' => [
        'thing1' => ['value' => '${data.thing1}'],
        'thing2' => '登录验证',
    ],
], [
    'page' => 'page',
    'data' => [
        'thing1' => '验证码',
    ],
]);

WechatOfficialAccount

$message = Message::channel('wechat_official_account')->sendTemplate(['oDx1b*****C3o0'], '1pNJGVRYV***ozu1AJKUlbGQ', [
    'data' => [
        'thing1' => ['value' => '验证码'],
        'thing2' => '登录验证',
    ],
]);

WechatServiceAccount

$message = Message::channel('wechat_service_account')->sendTemplate(['oDx1b*****C3o0'], '1pNJGVRYV***ozu1AJKUlbGQ', [
    'page' => '${page}',
    'data' => [
        'thing1' => ['value' => '验证码'],
        'thing2' => '登录验证',
    ],
], [
    'page' => 'page',
]);

WeWork

$message = Message::channel('wework_robot')->send(['oDx1b*****C3o0'], [
    'msgtype' => 'text',
    'text'    => [
        'content' => 'message.wework_robot.send',
    ],
]);
$message = Message::channel('wework_robot')->sendTemplate(['oDx1b*****C3o0'], 'demo', [
    'text' => [
        'content' => '${content}',
    ],
], [
    'content' => 'content',
    'at_all'  => true,
]);

Contributing

Contributions are what make the open source community such an amazing place to learn, inspire, and create. Any contributions you make are greatly appreciated.

If you have a suggestion that would make this better, please fork the repo and create a pull request. You can also simply open an issue with the tag "enhancement". Don't forget to give the project a star! Thanks again!

  1. Fork the Project
  2. Create your Feature Branch (git checkout -b feature/AmazingFeature)
  3. Commit your Changes (git commit -m 'Add some AmazingFeature')
  4. Push to the Branch (git push origin feature/AmazingFeature)
  5. Open a Pull Request

[back to top]

Contributors

Thanks goes to these wonderful people:

contrib.rocks image

Contributions of any kind are welcome!

[back to top]

License

Distributed under the MIT License (MIT). Please see License File for more information.

[back to top]

统计信息

  • 总下载量: 4
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 6
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 0
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2026-04-02

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固