PHPackages                             draguo/ding-notice - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. draguo/ding-notice

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

draguo/ding-notice
==================

钉钉自定义机器人发送

1.0.1(8y ago)131MITPHP

Since Jul 18Pushed 7y ago1 watchersCompare

[ Source](https://github.com/draguo/ding-notice)[ Packagist](https://packagist.org/packages/draguo/ding-notice)[ RSS](/packages/draguo-ding-notice/feed)WikiDiscussions master Synced 2d ago

READMEChangelogDependencies (2)Versions (4)Used By (0)

钉钉自定义机器人 api 的包装

[![Build Status](https://camo.githubusercontent.com/e5ed157ec59d08125aee9b34c7294a428c9ed6848b3d9f441abd2913250bce5c/68747470733a2f2f7472617669732d63692e6f72672f64726167756f2f64696e672d6e6f746963652e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/draguo/ding-notice)

### 请先阅读 [文档](https://open-doc.dingtalk.com/docs/doc.htm?spm=a219a.7629140.0.0.NVWSPm&treeId=257&articleId=105735&docType=1#)

[](#请先阅读-文档)

### 使用

[](#使用)

```
    // token 获取方法请参考上面的文档，传入 access_token= 后面的部分
    $ding = new Notice($token);
```

#### @功能

[](#功能)

to 方法是支持 @ 某人 或 @ 所有人，
如果是 @ 指定人，可以是对应的手机号数组或以英文逗号分隔的字符串
如果是 @ 所有人，传入字符串 all

### 消息类型

[](#消息类型)

#### text 类型

[](#text-类型)

```
    $message = new Text('hello world');
    $result = $ding->to('all')->send($message);
    // or
    $result = $ding->to(['18912341234'])->send('hello world');
```

#### link 类型

[](#link-类型)

```
$link = new \Draguo\Ding\Message\Link([
        "text" => "文字主体部分",
        "title" => "文字标题",
        "picUrl" => "",
        "messageUrl" => "https://mp.weixin.qq.com"
]);
$result = $notice->send($link);
```

#### markdown

[](#markdown)

```
$markdown = new \Draguo\Ding\Message\Markdown([
    "title" => "杭州天气",
    "text" => "#### 杭州天气 @156xxxx8827\n".
        "> 9度，西北风1级，空气良89，相对温度73%\n\n".
        "> ![screenshot](http://image.jpg)\n".
        "> ###### 10点20分发布 [天气](http://www.thinkpage.cn/) \n"
]);
$result = $notice->send($markdown);
```

#### 整体跳转ActionCard类型

[](#整体跳转actioncard类型)

```
$card = new \Draguo\Ding\Message\ActionCard([
    "title" => "乔布斯 20 年前想打造一间苹果咖啡厅，而它正是 Apple Store 的前身",
    "text" => "![screenshot](@lADOpwk3K80C0M0FoA)
               ### 乔布斯 20 年前想打造的苹果咖啡厅
               Apple Store 的设计正从原来满满的科技感走向生活化，而其生活化的走向其实可以追溯到 20 年前苹果一个建立咖啡馆的计划",
    "hideAvatar" => "0",
    "btnOrientation" => "0",
    "singleTitle" => "阅读全文",
    "singleURL" => "https://www.dingtalk.com/"
    ]);
$result = $notice->send($card);
```

#### 独立跳转ActionCard类型

[](#独立跳转actioncard类型)

```
$card = new \Draguo\Ding\Message\ActionCard([
    "title" => "乔布斯 20 年前想打造一间苹果咖啡厅，而它正是 Apple Store 的前身",
    "text" => "![screenshot](@lADOpwk3K80C0M0FoA)
               ### 乔布斯 20 年前想打造的苹果咖啡厅
                Apple Store 的设计正从原来满满的科技感走向生活化，而其生活化的走向其实可以追溯到 20 年前苹果一个建立咖啡馆的计划",
    "hideAvatar" => "0",
    "btnOrientation" => "0",
    "btns" => [
        [
            "title" => "内容不错",
            "actionURL" => "https://www.dingtalk.com/"
        ],
        [
            "title" => "不感兴趣",
            "actionURL" => "https://www.dingtalk.com/"
        ]
    ]
]);
$result = $notice->send($card);
```

#### FeedCard类型

[](#feedcard类型)

```
$feedCard = new \Draguo\Ding\Message\FeedCard([
    "links" => [
        [
            "title" => "时代的火车向前开",
            "messageURL" => "https://mp.weixin.qq.com/s?__biz=MzA4NjMwMTA2Ng==&mid=2650316842&idx=1&sn=60da3ea2b29f1dcc43a7c8e4a7c97a16&scene=2&srcid=09189AnRJEdIiWVaKltFzNTw&from=timeline&isappinstalled=0&key=&ascene=2&uin=&devicetype=android-23&version=26031933&nettype=WIFI",
            "picURL" => "https://www.dingtalk.com/"
        ],
        [
            "title" => "时代的火车向前开2",
            "messageURL" => "https://mp.weixin.qq.com/s?__biz=MzA4NjMwMTA2Ng==&mid=2650316842&idx=1&sn=60da3ea2b29f1dcc43a7c8e4a7c97a16&scene=2&srcid=09189AnRJEdIiWVaKltFzNTw&from=timeline&isappinstalled=0&key=&ascene=2&uin=&devicetype=android-23&version=26031933&nettype=WIFI",
            "picURL" => "https://www.dingtalk.com/"
        ]
    ]
]);

$result = $notice->send($feedCard);
```

###  Health Score

28

—

LowBetter than 54% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity9

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity65

Established project with proven stability

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~112 days

Total

3

Last Release

2997d ago

Major Versions

0.0.1 → 1.02018-02-15

### Community

Maintainers

![](https://www.gravatar.com/avatar/72f9a53e815a82dcedc10a1e865bc34defeed186b7a0b931d67885d6b6b251b5?d=identicon)[draguo](/maintainers/draguo)

---

Top Contributors

[![draguo](https://avatars.githubusercontent.com/u/12272760?v=4)](https://github.com/draguo "draguo (15 commits)")

---

Tags

dingtalk

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/draguo-ding-notice/health.svg)

```
[![Health](https://phpackages.com/badges/draguo-ding-notice/health.svg)](https://phpackages.com/packages/draguo-ding-notice)
```

###  Alternatives

[shlinkio/shlink

A self-hosted and PHP-based URL shortener application with CLI and REST interfaces

4.8k4.3k](/packages/shlinkio-shlink)[ralphjsmit/laravel-helpers

A package containing handy helpers for your Laravel-application.

13704.6k2](/packages/ralphjsmit-laravel-helpers)[dhlparcel/magento2-plugin

DHL Parcel plugin for Magento 2

11180.5k2](/packages/dhlparcel-magento2-plugin)[aedart/athenaeum

Athenaeum is a mono repository; a collection of various PHP packages

245.2k](/packages/aedart-athenaeum)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
