Skip to content

钉钉机器人通知(支持加签). dingtalk robot notification sdk.

License

Notifications You must be signed in to change notification settings

JetBlink/dingtalk-notify

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

19 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

DingTalk Notify

钉钉机器人通知(支持加签)。dingtalk robot notification sdk.

Overview

Installation

composer require jetblink/dingtalk-notify -vvv

Usage

获取实例

$dingTalk = new \JetBlink\DingtalkNotify\DingtalkNotify('your_dingtalk_robot_token');

发送消息

发送原始消息

$dingTalk->sendMessage([
    'msgtype' => 'text',
    'text'    => [
        'content' => '这是一条测试消息。',
    ],
    'at'      => [
        'atMobiles' => [],
        'isAtAll'   => false,
    ]
]);

发送文本消息

$dingTalk->sendTextMessage('这是一条文本测试消息。');

发送Markdown消息

$dingTalk->sendMarkdownMessage(
    'Markdown Test Title',
    "### Markdown  <font color='#ff0000'>测试消息</font>"
);

发送链接消息

$dingTalk->sendLinkMessage(
    'Link Test Title',
    "这是一条链接测试消息",
    'https://github.com/JetBlink',
    'https://avatars0.githubusercontent.com/u/40748346'
);

Tips

文本消息和Markdown消息都支持**@指定手机号@所有人**,参数位置见具体方法

官方文档

每个机器人每分钟最多发送20条

License

MIT

About

钉钉机器人通知(支持加签). dingtalk robot notification sdk.

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages