Hello,
I'm writing a mail wrapper using Swiftmail, and this will be held in a
library, not part of an action, model or view.
I need to change the layout from within this library class, once for
HTML mail, once for Plain Text mail.
What I've got so far isn't working - both bodies get rendered with the
default module layout.
Can anyone help?
cheers,
TP
---------------
// e.g. $module = 'client', $template='welcomeEmail'. public/
executeWelcomeEmailHTML and
// public/executeWelcomeEmailText are defined, as are
welcomeEmailHTMLSuccess.php and
// welcomeEmailTextSuccess.php templates.
$controller=sfContext::getInstance()->getController();
$action=$controller->getActionStack()->getLastEntry()-
>getActionInstance();
// Get our message bodies
$action->setLayout('mailHtml');
$htmlBody = $action->getPresentationFor($module, $template.'Html');
//$action->setLayout('mailText');
$textBody = $controller->getPresentationFor($module,$template.'Text');
$textBody = wordwrap($textBody);
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"symfony users" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/symfony-users?hl=en
-~----------~----~----~----~------~----~------~--~---