/** * {@inheritdoc) */ public function supports(\Swift_Mime_Message $message) { // why multipart/mixed, because if you attach a file, it'll be the contentType // So be careful to not use this transformer if you don't use text/html and attach a file return in_array($message->getContentType(), array('multipart/mixed', 'text/html')); }