I’m trying to process html email by rendering a template and layout inline, and sending the result. I can get a template to render inline, but wrapping it in a layout isn’t working. This is what I have so far:
$template = new sfPartialView(sfContext::getInstance(), 'email', 'send', 'my_template');
$template->setTemplate('my_template');
$template->setDecoratorTemplate('my_layout');
$email = $template->render();
Short answer:
You’re missing
$template->setDecorator(true).Long answer:
I extend
sfMailerand add a function called composeAndSendPartial that will send a partial to the provided email address. If you extendsfMailer, make sure you update your factories.yml.