public static function attachment($path_or_data = null, $filename = null, $contentType = null) {
        $from_path = realpath($path_or_data);
        if ($from_path) {
            $attachment = Swift_Attachment::fromPath($path_or_data, $contentType);
            $attachment->setFilename($filename);
        } else {
            $attachment = Swift_Attachment::newInstance($path_or_data, $filename, $contentType);
        }
        return $attachment;
    }