Make mailRecipient optional
This commit is contained in:
parent
027a159a1c
commit
83d721c1ca
|
@ -94,7 +94,7 @@ class Participant extends Model implements Preventable
|
|||
return $this->member?->preventions($this->form->from) ?: [];
|
||||
}
|
||||
|
||||
public function getMailRecipient(): stdClass
|
||||
public function getMailRecipient(): ?stdClass
|
||||
{
|
||||
return $this->getFields()->getMailRecipient();
|
||||
}
|
||||
|
|
|
@ -16,5 +16,5 @@ interface Preventable
|
|||
*/
|
||||
public function preventions(): array;
|
||||
|
||||
public function getMailRecipient(): stdClass;
|
||||
public function getMailRecipient(): ?stdClass;
|
||||
}
|
||||
|
|
|
@ -25,7 +25,7 @@ class PreventionRememberMail extends Mailable
|
|||
{
|
||||
$this->settings = app(InvoiceSettings::class);
|
||||
$this->bodyText = $this->bodyText
|
||||
->replaceWithList('wanted', collect($preventable->preventions())->map(fn ($prevention) => $prevention->text())->toArray());
|
||||
->replaceWithList('wanted', collect($preventable->preventions())->map(fn($prevention) => $prevention->text())->toArray());
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
Loading…
Reference in New Issue