[FLOW3-general] Sending Mails with Fluid - where is the proper place in the application architecture?
Erik Frister
ef at aijko.de
Tue Jan 17 16:57:13 CET 2012
Hi guys,
I have a question regarding sending mails:
I have developed a very basic way to send an email to an administrator
when a user submits a contact form. Please see
https://gist.github.com/1627122 for the roughly 30 lines of code I used.
I basically searched my way around the code to come up with the
solution. Basically, this script renders two mails, HTML and Plaintext,
located in Resources/Private/Templates/@Controller/Mails/@Action. at Format.
I have two questions:
1. Is this a legitimate way of creating and rendering the Fluid view? Or
is there a more simple way? I tried using $this->view->renderPartial()
without success.
2. What bothers me most is that the mail-sending logic is inside the
controller action. Looking inside the Blog example, you guys send a mail
(without Fluid) using a signal and a slot. However, in order to use
Fluid (at least in my implementation) I need the controllerContext and
some protected methods of the Controller, which will not be accessible
inside the Slot. Given that I will be sending a lot more emails (e.g.
DOI, private messages etc) can you guys give me your thoughts as to what
the architectually most elegant way of a mail sending implementation
would be?
Thanks,
Erik
More information about the FLOW3-general
mailing list