Skip to content

Commit

Permalink
docs(readme): Add example for DingTalk client usage
Browse files Browse the repository at this point in the history
- Introduce a code example demonstrating how to use the DingTalk client
- Include authentication and message sending process
- Highlight the structure for creating a BtnsActionCardMessage
- Provide a quick start guide for new users
  • Loading branch information
guanguans committed Nov 14, 2024
1 parent 27d2b2f commit 54e80bc
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,20 @@ composer require guanguans/notify -v

### Quick start

```php
$response = (new Guanguans\Notify\DingTalk\Client(
new Guanguans\Notify\DingTalk\Authenticator('c44fec1ddaa8a833156efb77b7865d62ae13775418030d94d05da08bfca73')
))
->send(
Guanguans\Notify\DingTalk\Messages\BtnsActionCardMessage::make([
'title' => 'This is title(keyword).',
'text' => 'This is text.',
])
)
// ->dump()
->json();
```

```php
// 1. Create authenticator
$authenticator = new Guanguans\Notify\DingTalk\Authenticator(
Expand Down

0 comments on commit 54e80bc

Please sign in to comment.