Commit d744cc4b authored by 王源's avatar 王源 🎧

[功能]添加自动发送文本消息方法

parent ef29af67
...@@ -81,6 +81,22 @@ class MessageHandler ...@@ -81,6 +81,22 @@ class MessageHandler
$this->messageService->send($receiverIds, $application, $templateId, 0, $replace); $this->messageService->send($receiverIds, $application, $templateId, 0, $replace);
} }
/**
* 自动发送文本消息
* @param $receiverIds
* @param $content
* @throws \Exception
*/
public function sendAutoText($receiverIds, $content)
{
$application = $this->config->get('app_name');
if (!$application) {
throw new \Exception("请设置应用名app_name");
}
$receiverIds = is_array($receiverIds) ? $receiverIds : [$receiverIds];
$this->messageService->send($receiverIds, $application, 0, 0, [], $content);
}
/** /**
* 定时任务专用 发送文本消息 * 定时任务专用 发送文本消息
* @param $receiverIds * @param $receiverIds
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment