Pagekit\Mail\Message::embedFile PHP Method

embedFile() public method

Embeds a file in the message and get the CID.
public embedFile ( string $file, string $cid = null ) : string
$file string
$cid string
return string
    public function embedFile($file, $cid = null)
    {
        $attachment = Swift_Image::fromPath($file);
        if ($cid) {
            $attachment->setId(strpos($cid, 'cid:') === 0 ? $cid : 'cid:' . $cid);
        }
        return $this->embed($attachment);
    }