Fix PreventionRememberAction
This commit is contained in:
parent
d44ad4bc53
commit
cf77797512
|
@ -23,18 +23,14 @@ class PreventionRememberAction
|
|||
->orWhereNull('last_remembered_at')
|
||||
);
|
||||
foreach ($query->get() as $participant) {
|
||||
if (count($participant->preventions()) === 0) {
|
||||
return;
|
||||
if ($participant->getFields()->getMailRecipient() === null || count($participant->preventions()) === 0) {
|
||||
continue;
|
||||
}
|
||||
|
||||
$body = app(PreventionSettings::class)->refresh()->formmail
|
||||
->placeholder('formname', $participant->form->name)
|
||||
->append($participant->form->prevention_text);
|
||||
|
||||
if ($participant->getFields()->getMailRecipient() === null) {
|
||||
continue;
|
||||
}
|
||||
|
||||
Mail::send(new PreventionRememberMail($participant, $body));
|
||||
|
||||
$participant->update(['last_remembered_at' => now()]);
|
||||
|
|
Loading…
Reference in New Issue