留言板

Send email in Freemarker Template

Etienne Roy,修改在9 年前。

Send email in Freemarker Template

Regular Member 帖子: 114 加入日期: 13-8-8 最近的帖子
Hi

It is possible to send email in a freemarker template ?

Thank
Etienne Roy,修改在9 年前。

RE: Send email in Freemarker Template

Regular Member 帖子: 114 加入日期: 13-8-8 最近的帖子
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,修改在9 年前。

RE: Send email in Freemarker Template

Junior Member 帖子: 70 加入日期: 12-4-26 最近的帖子
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,修改在9 年前。

RE: Send email in Freemarker Template

Liferay Legend 帖子: 6403 加入日期: 08-9-23 最近的帖子
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)