Tools\Mailer\Email::addBlobAttachment PHP Method

addBlobAttachment() public method

Add an attachment as blob
public addBlobAttachment ( string $content, string $filename, string | null $mimeType = null, array $fileInfo = [] )
$content string Blob data
$filename string to attach it
$mimeType string | null (leave it empty to get mimetype from $filename)
$fileInfo array
    public function addBlobAttachment($content, $filename, $mimeType = null, $fileInfo = [])
    {
        if ($mimeType === null) {
            $ext = pathinfo($filename, PATHINFO_EXTENSION);
            $mimeType = $this->_getMimeByExtension($ext);
        }
        $fileInfo['data'] = $content;
        $fileInfo['mimetype'] = $mimeType;
        $file = [$filename => $fileInfo];
        return $this->addAttachments($file);
    }