I don't find easy way to do that. Looks like rendering of a template is complicated when you want to specify a module.

For example, this should work :

   public function executeSend()
   {
      $body->setTemplate('sendSuccess"); // .php ?
      $body = $this->getView()->render();
   }

But rendering on a different module is complicated.

And using filenames for specifying partial/page is not a good idea.

You should really consider converting your layout to partial, you are using big machine for a minor issue.

getView on sfController : http://www.symfony-project.org/api/1_3/sfController#method_getview view on sfPHPView : http://www.symfony-project.org/api/1_4/sfPHPView#method_render

Alexandre

Le 19/08/10 23:18, Antoine S. a écrit :
Hi,

I quiet like to use the dispatcher to send email.
The listener will build the email.

For the layout, I only use partial -renderPartial(), that can act as a
layout because you can
include other partial/component in a partial.

Maybe with sfView or sfPHPView there is a way to render a complete
layout..
I am quiet interested too if there is an easy solution.

If not, partial and component are good.

On Aug 19, 1:22 am, Georg<geor...@have2.com>  wrote:
Hello,

I am confused. I would like to send emails with layout and template from
any place in my project, application or a task.
Reading the docs
(http://www.symfony-project.org/more-with-symfony/1_4/en/04-Emails), it
tells me to put each email in a class, and "Of course, adding a base
class to centralize the shared headers like the From header, or to add a
common signature can be convenient".

Here comes the part why I am unhappy and confused, I have a cool MVC
framework, and for emails I should go back to home-brew PHP and mix view
and controller?

Wouldn't it be cleaner to put the email views in a plugin, and make them
accessible from everywhere?

I would have expected a plugin that makes this possible, but no.

How are you doing it, where do you put the presentation layers of your
emails?

Georg

--
Alexandre Salomé - http://alexandre.salome.fr

--
If you want to report a vulnerability issue on symfony, please send it to 
security at symfony-project.com

You received this message because you are subscribed to the Google
Groups "symfony users" group.
To post to this group, send email to symfony-users@googlegroups.com
To unsubscribe from this group, send email to
symfony-users+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/symfony-users?hl=en

Reply via email to