Fix PreventionRememberAction
continuous-integration/drone/tag Build is passing Details
continuous-integration/drone/push Build is passing Details

This commit is contained in:
philipp lang 2024-07-10 00:52:05 +02:00
parent d44ad4bc53
commit cf77797512
1 changed files with 2 additions and 6 deletions

View File

@ -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()]);