Laravel如何检查是否已发出通知
我最初有此电子邮件通知,该通知是按需或按计划触发的。我想知道如何确定是否已派发通知(未找到错误)(Failed_jobs
表中报告的错误)。
要触发的可引用类:
<?php
class SendCertificates
{
public function __invoke()
{
if($this->send_certificate($certificate)){
//NEVER EXECUTED, since return is VOID
$this->mark_as_delivered($certificate);
}else{
//handle not sent, check error, etc.
}
}
public function send_certificate(Certificate $certificate)
{
//'void' method 'notify' result used
return Notification::route('mail',[
$certificate->participant->email=>$certificate->participant->name,
])->notify(new CertificateIssued($certificate))
;
}
}
对于最后一个返回通知
有此警告:
'void'方法'notify'使用
,如何确定通知的结果?告诉它是否是派遣的?
I initially have this email notification, which is triggered either on demand or on schedule. I want to know how to determine whether the notification has been dispatched (no errors found) or not (error reported in the failed_jobs
table).
Invokable class to be triggered:
<?php
class SendCertificates
{
public function __invoke()
{
if($this->send_certificate($certificate)){
//NEVER EXECUTED, since return is VOID
$this->mark_as_delivered($certificate);
}else{
//handle not sent, check error, etc.
}
}
public function send_certificate(Certificate $certificate)
{
//'void' method 'notify' result used
return Notification::route('mail',[
$certificate->participant->email=>$certificate->participant->name,
])->notify(new CertificateIssued($certificate))
;
}
}
For that last return Notification
there's this warning:
'void' method 'notify' result used
So how do I determine the result of the Notification? To tell whether it was dispatched or not?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论