/**
* @param $emailContent
* @param $preheader
* @param Campaign $campaign
* @return mixed
*/
public static function injectPreheader($emailContent, $preheader, Campaign $campaign)
{
$hideCss = 'display:none!important;mso-hide:all;';
$style = sprintf('<style type="text/css">span.preheader{%s}</style>', $hideCss);
$emailContent = str_ireplace('</head>', $style . '</head>', $emailContent);
$preheader = sprintf('<span class="preheader" style="%s">%s</span>', $hideCss, $preheader);
return preg_replace('/<body([^>]+)?>/six', '$0' . $preheader, $emailContent);
}