消息推送增加邮箱&&增加终版保存功能

This commit is contained in:
mzl
2025-09-15 15:01:19 +08:00
parent 3208fbd501
commit f152529364
14 changed files with 209 additions and 24 deletions
+15 -2
View File
@@ -17,10 +17,23 @@ class Notice implements Consumer
public function consume($data)
{
try {
(new \app\common\service\MessageNotificationsService())->pushNotice($data);
// 应用消息
$service = new \app\common\service\MessageNotificationsService();
$service->pushNotice($data);
// 邮件消息
if (isset($data['email']) && $data['email'] === 1) {
$emails = $service->getUserEmailsById($data['recipient']);
foreach ($emails as $email) {
if (empty($email)) {
continue;
}
\app\common\utils\email\MailSend::send($email, $data['title'], $data['content']);
}
}
return true;
} catch (\Throwable $th) {
var_dump('4 :'.$th->getFile()."|".$th->getLine()."|".$th->getMessage());
flg("消息推送异常:".$th->getFile()."|".$th->getLine()."|".$th->getMessage());
throw new BusinessException($th->getFile()."|".$th->getLine()."|".$th->getMessage());
}
}