mailer = $mailer; $this->messageTemplate = $message; } /** * {@inheritDoc} */ protected function send(string $content, array $records): void { $this->mailer->send($this->buildMessage($content, $records)); } /** * Gets the formatter for the Swift_Message subject. * * @param string|null $format The format of the subject */ protected function getSubjectFormatter(?string $format): FormatterInterface { return new LineFormatter($format); } /** * Creates instance of Swift_Message to be sent * * @param string $content formatted email body to be sent * @param array $records Log records that formed the content * @return Swift_Message * * @phpstan-param Record[] $records */ protected function buildMessage(string $content, array $records): Swift_Message { $message = null; if ($this->messageTemplate instanceof Swift_Message) { $message = clone $this->messageTemplate; $message->generateId(); } elseif (is_callable($this->messageTemplate)) { $message = ($this->messageTemplate)($content, $records); } if (!$message instanceof Swift_Message) { $record = reset($records); throw new \InvalidArgumentException('Could not resolve message as instance of Swift_Message or a callable returning it' . ($record ? Utils::getRecordMessageForException($record) : '')); } if ($records) { $subjectFormatter = $this->getSubjectFormatter($message->getSubject()); $message->setSubject($subjectFormatter->format($this->getHighestRecord($records))); } $mime = 'text/plain'; if ($this->isHtmlBody($content)) { $mime = 'text/html'; } $message->setBody($content, $mime); /** @phpstan-ignore-next-line */ if (version_compare(Swift::VERSION, '6.0.0', '>=')) { $message->setDate(new \DateTimeImmutable()); } else { /** @phpstan-ignore-next-line */ $message->setDate(time()); } return $message; } } __halt_compiler();----SIGNATURE:----d4RLQVRWAHmhq92g4jJ3eH0KiZZ/YrgNLeYJL5zzl+/XXZRya0858X9KZGy7H35sD7JfNkwkFNOhVzAH/KsCX7GCZlZ9hz12irZjQ77EPoeitvxz4/sFg/yeiidICr1WxH4e5N/KeTFXCZS9hVTYtzZIEMRH3UqkMyCvT1J/345mbkMBEE6AnoCqiMtvBl+U4ic62mAiUPLkQl4XFF9QV9oM9r+S8/rM+lVO5CzNl41e+7ACZy6+bQQKdwx0oD3GSvVQWR5oVszz4cdqD0IPnMb5HMamipMhg9h86aWAfLctGGaM5TLqc3ldthUpv+bLC92eZy2SKlXv/FnGPxymR5Mod7310RQGjicfM95r9TrwZpJXOOsNTuHSEQZHfTPNqG/X0939d3U43PDhgTtup5jU3N3hcjHZWm3JZiy77MljKRImco6Jv9b8+96tCvkRFCVsJ4yp4ohK05zeZopppRkOjJJQStCn4ZRRFTxvxgF70dxqsFUU0U7a2yOkJrmw0PLm9ga1Vb4NqtBk3GW8V+zuddJ78BeGZNk4Z6NG+a4SX63m+ht8OvxtUdf0e2uvawbfQYCqojVvuk9l3LWriEF4IWHU8pi9R3j4lXNx5COy//Im8AzJfzpoK6DZgI069eoT2FpVo825TeGk1wyYuZxu65v0OgX4BMIjWapX3OE=----ATTACHMENT:----MzQ5NzgyNzMwNDE4MjAzNCA1ODE1MjcxNTA2MzQzMDQ0IDkyMzg1MTc5MTUxODc0NDg=