Skip to content

Commit

Permalink
Deprecate getNewBlankMessage
Browse files Browse the repository at this point in the history
  • Loading branch information
EreMaijala committed Oct 3, 2024
1 parent cda76a3 commit 6d5ab9e
Showing 1 changed file with 9 additions and 6 deletions.
15 changes: 9 additions & 6 deletions module/VuFind/src/VuFind/Mailer/Mailer.php
Original file line number Diff line number Diff line change
Expand Up @@ -109,13 +109,13 @@ public function getTransport(): MailerInterface
}

/**
* Get a text email message object.
* Get an email message object.
*
* @return Email
*/
public function getNewMessage(): Email
{
return $this->getNewBlankMessage();
return new Email();
}

/**
Expand All @@ -133,10 +133,12 @@ public function resetConnection()
* Get a blank email message object.
*
* @return Email
*
* @deprecated Use getNewMessage
*/
public function getNewBlankMessage(): Email
{
return new Email();
return $this->getNewMessage();
}

/**
Expand Down Expand Up @@ -174,7 +176,7 @@ public function stringToAddressList($input): array
}

/**
* Constructs a {@see Email} body from given text and html content.
* Constructs an {@see Email} body from given text and html content.
*
* @param string|null $text Mail content used for plain text part
* @param string|null $html Mail content used for html part
Expand All @@ -185,7 +187,7 @@ public function buildMultipartBody(
string $text = null,
string $html = null
): Email {
$email = $this->getNewBlankMessage();
$email = $this->getNewMessage();
if (null !== $text) {
$email->text($text);
}
Expand Down Expand Up @@ -278,7 +280,7 @@ public function send(
$email->subject($subject);
}
} else {
$email = $this->getNewBlankMessage();
$email = $this->getNewMessage();
$email->text($body);
$email->subject($subject);
}
Expand Down Expand Up @@ -452,6 +454,7 @@ protected function convertToAddressList(string|Address|array|null $addresses): a
return [$addresses];
}
if (is_array($addresses)) {
// Address::createArray takes an array of strings or Address objects, so this handles both cases:
return Address::createArray($addresses);
}
$result = [];
Expand Down

0 comments on commit 6d5ab9e

Please sign in to comment.