Forums de discussion

Send email in Freemarker Template

Etienne Roy, modifié il y a 9 années.

Send email in Freemarker Template

Regular Member Publications: 114 Date d'inscription: 08/08/13 Publications récentes
Hi

It is possible to send email in a freemarker template ?

Thank
Etienne Roy, modifié il y a 9 années.

RE: Send email in Freemarker Template

Regular Member Publications: 114 Date d'inscription: 08/08/13 Publications récentes
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, modifié il y a 8 années.

RE: Send email in Freemarker Template

Junior Member Publications: 70 Date d'inscription: 26/04/12 Publications récentes
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, modifié il y a 8 années.

RE: Send email in Freemarker Template

Liferay Legend Publications: 6396 Date d'inscription: 23/09/08 Publications récentes
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)