Skip to content

Commit

Permalink
Emailer: Fix compatibility and make insertMessageToQueue as public.
Browse files Browse the repository at this point in the history
  • Loading branch information
janbarasek committed Jan 27, 2022
1 parent cef3533 commit 2a9d6c2
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/Emailer.php
Original file line number Diff line number Diff line change
Expand Up @@ -67,15 +67,15 @@ public function __construct(
* When sending messages, please prefer own Message entity from this package.
* Attachments will be physically stored on disk.
*/
public function send(NetteMessage $mail): Email
public function send(NetteMessage $mail): void
{
$urgent = ($mail instanceof Message && $mail->isUrgent());
if ($urgent === false && $this->configuration->isUseQueue() === true) {
return $this->insertMessageToQueue($mail);
$this->insertMessageToQueue($mail);
return;
}
$mail->setPriority($urgent === true ? Message::HIGH : $mail->getPriority() ?? Message::NORMAL);

return $this->sendNow($mail);
$this->sendNow($mail);
}


Expand Down Expand Up @@ -289,7 +289,7 @@ public function setUseQueue(bool $useQueue): void
}


private function insertMessageToQueue(NetteMessage $message, string $sendEarliestAt = 'now'): Email
public function insertMessageToQueue(NetteMessage $message, string $sendEarliestAt = 'now'): Email
{
if (trim($message->getBody()) === '' && trim($message->getHtmlBody()) === '') {
throw new \InvalidArgumentException(__METHOD__ . ': Empty mail (no body)');
Expand Down

0 comments on commit 2a9d6c2

Please sign in to comment.