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