protected function format(MessageInterface $message)
    {
        // Custom headers should be prefixed with h:X-My-Header
        $headers = array_merge(
            $message->getHeaders(),
            ['Reply-To' => $message->getReplyTo()]
        );
        array_walk($headers, function (&$value, &$key) {
            $key = 'h:'.$key;
        });

        $parameters = [
            'from'    => $this->buildIdentityString($message->getFrom()),
            'to'      => $this->buildIdentityString($message->getTo()),
            'subject' => $message->getSubject(),
            'text'    => $message->getText(),
            'html'    => $message->getHtml(),
            'cc'      => $this->buildIdentityString($message->getCc()),
            'bcc'     => $this->buildIdentityString($message->getBcc()),
        ];

        if ($message instanceof TaggableInterface) {
            $parameters['o:tag'] = (array) $message->getTag();
        }

        $metadata = [];
        if ($message instanceof MetadataAwareInterface) {
            $metadata = array_filter($message->getMetadata());
            // Custom variables should be prefixed with v:my_var
            array_walk($metadata, function (&$value, &$key) {
                $key = 'v:'.$key;
            });
        }

        return http_build_query(array_filter(array_merge($headers, $parameters, $metadata)));
    }
protected function format(MessageInterface $message)
    {
        // Custom headers should be prefixed with h:X-My-Header
        $headers = array_merge(
            $message->getHeaders(),
            ['Reply-To' => $message->getReplyTo()]
        );
        array_walk($headers, function (&$value, &$key) {
            $key = 'h:'.$key;
        });

        $parameters = [
            'from'    => $this->buildIdentityString($message->getFrom()),
            'to'      => $this->buildIdentityString($message->getTo()),
            'subject' => $message->getSubject(),
            'text'    => $message->getText(),
            'html'    => $message->getHtml(),
            'cc'      => $this->buildIdentityString($message->getCc()),
            'bcc'     => $this->buildIdentityString($message->getBcc()),
        ];

        if ($message instanceof TaggableInterface) {
            $parameters['o:tag'] = (array) $message->getTag();
        }

        $metadata = [];
        if ($message instanceof MetadataAwareInterface) {
            $metadata = array_filter($message->getMetadata());
            // Custom variables should be prefixed with v:my_var
            array_walk($metadata, function (&$value, &$key) {
                $key = 'v:'.$key;
            });
        }

        return http_build_query(array_filter(array_merge($headers, $parameters, $metadata)));
    }
{@inheritdoc}