[TYPO3-mvc] Where is the right place for methods like sendEmailAfterNewObjectIsSaved() in your extbase extension?
Bastian Waidelich
bastian at typo3.org
Mon Jun 25 16:40:58 CEST 2012
Roland wrote:
Hi Roland,
> where do you put the following functionality in your extbase extension?
>
> example: after creating a new object/record via frontend form of your
> extbase extension an email should be sent to the admin of the website
> which informs him about the new object/record being saved.
> you could add a sendEmailAfterNewObjectIsSaved() method to the domain
> model object class of the object that was created.
> is this the right place for this functionality?
No, unless your domain model is an "Email" ;)
Instead you could create a NotificationService that uses the fluid
standalone view to send an email [1].
If you want to decouple it even more, you can execute the notification
via signal/slot or hooks.
HTH
[1]
http://forge.typo3.org/projects/typo3v4-mvc/wiki/How_to_use_the_Fluid_Standalone_view_to_render_template_based_emails
--
Bastian Waidelich
TYPO3 Core Team Member
TYPO3 .... inspiring people to share!
Get involved: typo3.org
More information about the TYPO3-project-typo3v4mvc
mailing list