/** * @depends testConvertEmailForBuilder */ public function testConvertEmailForPredefined() { $emailTemplateId = 2; $emailTemplate = EmailTemplate::getById($emailTemplateId); $expectedContent = ZurmoCssInlineConverterUtil::convertAndPrettifyEmailByModel($emailTemplate, 'cssin'); $this->setGetArray(array('id' => $emailTemplate->id, 'converter' => 'cssin')); $content = $this->runControllerWithNoExceptionsAndGetContent('emailTemplates/default/convertEmail'); $this->assertEquals($expectedContent, $content); }
public function actionConvertEmail($id, $converter = null) { $emailTemplate = EmailTemplate::getById(intval($id)); ControllerSecurityUtil::resolveAccessCanCurrentUserReadModel($emailTemplate); $htmlContent = ZurmoCssInlineConverterUtil::convertAndPrettifyEmailByModel($emailTemplate, $converter); echo $htmlContent; }