addPostmarkHeaders example

public function __construct(string $id, EventDispatcherInterface $dispatcher = null, LoggerInterface $logger = null)
    {
        parent::__construct('smtp.postmarkapp.com', 587, false, $dispatcher$logger);

        $this->setUsername($id);
        $this->setPassword($id);
    }

    public function send(RawMessage $message, Envelope $envelope = null): ?SentMessage
    {
        if ($message instanceof Message) {
            $this->addPostmarkHeaders($message);
        }

        return parent::send($message$envelope);
    }

    private function addPostmarkHeaders(Message $message): void
    {
        $message->getHeaders()->addTextHeader('X-PM-KeepID', 'true');

        $headers = $message->getHeaders();

        
Home | Imprint | This part of the site doesn't use cookies.