Foros de discusión

Send email in Freemarker Template

Etienne Roy, modificado hace 9 años.

Send email in Freemarker Template

Regular Member Mensajes: 114 Fecha de incorporación: 8/08/13 Mensajes recientes
Hi

It is possible to send email in a freemarker template ?

Thank
Etienne Roy, modificado hace 9 años.

RE: Send email in Freemarker Template

Regular Member Mensajes: 114 Fecha de incorporación: 8/08/13 Mensajes recientes
I try to use the variable serviceLocator but I always have this error Expression serviceLocator is undefined on line ...
do you know why is not work ?

example
<#assign DDLRecordLocalService = serviceLocator.findService("com.liferay.portlet.dynamicdatalists.service.DDLRecordLocalService")>
thumbnail
Cody Hoag, modificado hace 9 años.

RE: Send email in Freemarker Template

Junior Member Mensajes: 70 Fecha de incorporación: 26/04/12 Mensajes recientes
The answer to your second question can be found on the following message board thread:

https://www.liferay.com/community/forums/-/message_boards/message/37572364
thumbnail
Olaf Kock, modificado hace 9 años.

RE: Send email in Freemarker Template

Liferay Legend Mensajes: 6403 Fecha de incorporación: 23/09/08 Mensajes recientes
Is it possible? Yes, see the other answers.

Should you do this? Most likely not. Freemarker Templates are view technology. Use your business layer to implement anything outside of the view realm, not templates. If this would go through my code review, I'd probably reject it unless you are implementing a very rare corner case or can really argue well for it (which I don't expect)