protected function embedImage(\Swift_Message $message, \DOMAttr $node, array &$images): void
    {
        if (0 === strpos($node->nodeValue, 'cid:')) {
            return;
        }

        if (isset($images[$node->nodeValue])) {
            $node->nodeValue = $images[$node->nodeValue];
        } else {
            $node->nodeValue = EmbedImageUtil::getLocalPath($node->nodeValue, $this->webDir, $this->hostPattern);
            $cid = $message->embed(\Swift_Image::fromPath($node->nodeValue));
            $images[$node->nodeValue] = $cid;
            $node->nodeValue = $cid;
        }
    }
protected function embedImage(\Swift_Message $message, \DOMAttr $node, array &$images): void
    {
        if (0 === strpos($node->nodeValue, 'cid:')) {
            return;
        }

        if (isset($images[$node->nodeValue])) {
            $node->nodeValue = $images[$node->nodeValue];
        } else {
            $node->nodeValue = EmbedImageUtil::getLocalPath($node->nodeValue, $this->webDir, $this->hostPattern);
            $cid = $message->embed(\Swift_Image::fromPath($node->nodeValue));
            $images[$node->nodeValue] = $cid;
            $node->nodeValue = $cid;
        }
    }
protected function embedImage ( \ Swift_Message $ message , \ DOMAttr $ node , array & $ images ) : void { if ( 0 === strpos ( $ node -> nodeValue , 'cid:' ) ) { return ; } if ( isset ( $ images [ $ node -> nodeValue ] ) ) { $ node -> nodeValue = $ images [ $ node -> nodeValue ] ; } else { $ node -> nodeValue = EmbedImageUtil :: getLocalPath ( $ node -> nodeValue , $ this -> webDir , $ this -> hostPattern ) ; $ cid = $ message -> embed ( \ Swift_Image :: fromPath ( $ node -> nodeValue ) ) ; $ images [ $ node -> nodeValue ] = $ cid ; $ node -> nodeValue = $ cid ; } }
Embed the image in message and replace the image link by attachment id.

@param \Swift_Message $message The swift mailer message
@param \DOMAttr       $node    The dom attribute of image
@param array          $images  The map of image ids passed by reference
Embed the image in message and replace the image link by attachment id .