消息推送增加邮箱&&增加终版保存功能
This commit is contained in:
@@ -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());
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user