This repository has been archived by the owner on May 7, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 117
消息类型
张铭阳 edited this page Sep 30, 2017
·
2 revisions
钉钉支持文本、图片、音频、文件、链接、OA、卡片以及 markdown 消息类型
SDK 已封装好这些消息类型,所有的消息类都在
EasyDingTalk\Kernel\Messages
这个命名空间下
new Text('文本消息内容');
new Image([
'media_id' => 'MEDIA_ID',
]);
new Voice([
'media_id' => 'MEDIA_ID',
'duration' => '10',
]);
new File([
'media_id' => 'MEDIA_ID',
]);
new Link([
'title' => 'TITLE',
'text' => 'TEXT',
'pic_url' => 'PIC_URL',
'message_url' => 'http://www.dingtalk.com',
]);
new OA([
'message_url' => 'http://www.dingtalk.com',
'pc_message_url' => 'http://www.dingtalk.com',
// ...
]);
卡片消息支持无 Action 样式、单一 Action 样式,和多 Action 样式,传入相对于的参数即可
new Card([
'title' => 'TITLE',
'markdown' => '## Content',
// ...
]);
new Markdown([
'title' => 'TITLE',
'text' => '## Content',
]);
COPYRIGHT © MINGYOUNG