♻️ code clean-up
This commit is contained in:
parent
5a424771fd
commit
a94a9baf4c
4 changed files with 10 additions and 23 deletions
|
@ -25,7 +25,7 @@ class EventMailingList extends BaseMailingList {
|
|||
* @return array
|
||||
*/
|
||||
protected function getEntity(): array {
|
||||
return $this->event ?? NULL;
|
||||
return $this->event;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -39,6 +39,12 @@ class EventMailingList extends BaseMailingList {
|
|||
$this->event = $value;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get a list of recipients indexed by email address.
|
||||
*
|
||||
* @return array List of recipients (MailListRecipient)
|
||||
* @throws \Civi\Mailinglistsync\Exceptions\MailinglistException
|
||||
*/
|
||||
public function getRecipients(): array {
|
||||
try {
|
||||
$recipientData = Contact::get()
|
||||
|
@ -72,7 +78,7 @@ class EventMailingList extends BaseMailingList {
|
|||
);
|
||||
} catch (\Exception $e) {
|
||||
throw new MailinglistException(
|
||||
"Could not create recipient object for contact with id '{$recipient['id']}'\n$e",
|
||||
"Could not create recipient object for contact with id '{$recipient['id']}': $e",
|
||||
MailinglistException::ERROR_CODE_GET_RECIPIENTS_FAILED
|
||||
);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue