【发布时间】:2020-03-19 15:25:41
【问题描述】:
我正在开发一个功能来发送“级联”或notifications 链,它们之间有不同的通道延迟。例如:
电子邮件 ->(30 分钟后)-> 推送 ->(30 分钟后)-> 短信
该流程运行良好,现在是用户完成某事或执行我希望链停止的操作。所以我停止或阻止发送通知。这是我尝试过的,但stop them 似乎没有。
我试过了:
public function via($notifiable)
{
if (whatever condition to stop) {
return null; // also tried with return []
}
return ['mail'];
}
还有
public function __construct(array $data = [])
{
if (whatever condition to stop) {
exit; // are you desperate, bruh?
}
}
有什么我没有看到的超级明显的东西吗?可能与我们的自定义调度程序有关。 您知道我可以在哪里中断应用程序以阻止发送通知吗?
【问题讨论】:
标签: php laravel notifications