PHP code example of wangchengtao / exception-notify
1. Go to this page and download the library: Download wangchengtao/exception-notify library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
use Summer\MessageNotify\Channel\AbstractChannel;
use Summer\MessageNotify\Message\AbstractMessage;
class CustomChannel extends AbstractChannel
{
public function handleResponse(ResponseInterface $response): void
{
//
}
public function notify(AbstractMessage $message): ResponseInterface
{
//
}
}
class CustomMessage extends AbstractMessage
{
public function getBody() : array
{
//
}
}
$message = new CustomMessage();
$message->setTitle('自定义标题');
$message->setContent('自定义消息');
$channel = new CustomChannel([
'access_token' => 'xxxxxxxxxxxxx',
]);
$client = new Client($channel);
$client->send($text);
Loading please wait ...
Before you can download the PHP files, the dependencies should be resolved. This can take some minutes. Please be patient.