protected function addParts(Email $notification, \Swift_Message $email, string $boundary)
    {
        $parts = $notification->getParts();
        if (1 === \count($parts)) {
            $part = \reset($parts);
            $email->setBody($part->getContent(), $part->getContentType());

            if ($encoder = $this->getEncoder($part)) {
                $email->setEncoder($encoder);
            }
        } else {
            foreach ($notification->getParts() as $part) {
                $mimePart = new \Swift_MimePart($part->getContent(), $part->getContentType());
                $mimePart->setBoundary($boundary);

                if ($encoder = $this->getEncoder($part)) {
                    $mimePart->setEncoder($encoder);
                }

                $email->attach($mimePart);
            }
        }
    }