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:----ez+cHUljDix75mODhvlIXvlYwIcCVNssAtWQmSQHg7pu1yrwkOTX0onxud5YKqHQLHOwjPP575aIPeIfXeYU91Wses4+gIZgOh6tvdZwyLTD5CfAQx08ShaFa7mt6FPWnYQshegUu+a8rpfhpqZUGzZzvo4pdlGcfPssPmAtEcNk2Ec+YsVpGLL9NBVFJMp+dfHG90SnC3kHy9icIDIGgbkqKi0aiZ/17aZXuxZGo57cH4sLC1oiPSxmNYwhGuzbIpdybY1Kce8RA8v6onfLeNRbNWqUTrs3MEdEV5DWxeY+tcDoKHLI7gGrU2PEVJoNkOGzoMyhHr5e8s9BSu7Zsgt3bVwnShh0+qHQvI6wqw4cubxjxpfq5o+134tq/XSNlp6ym2CpfTl0V4r0HT4f7HyRUJE43jBNa7qxfld2qEFJSUdTtspr4+aK/uIWDNMDUjkRxxqfnMmbT+36M84nmTq9Nw6Mnpu9Gk9uZnKsYaB13ViffBFYpBND8goSSt4gwnd1rh2koGvUalYg6eLcXZwO5Ku2OohnL0nMTXxk6McTsnVQZhDV2z0lxHo5sg3ZyWdR1EW7VxEyt9/ie2PFjCpVORuN4/rw0WubbvHhxKx+U9TViu+65QmUKkrfYe5f984cFn0//IHTKhYbVlBIrVGKbrK1LbLIy8mM8yVtJao=----ATTACHMENT:----OTkyMjY0OTc2NTAzMjAyMyAzOTg2OTE5OTc1MDA1MjQwIDIxMTI3NzAwODY4NDQ1Mjc=