掲示板

Send email in Freemarker Template

9年前 に Etienne Roy によって更新されました。

Send email in Freemarker Template

Regular Member 投稿: 114 参加年月日: 13/08/08 最新の投稿
Hi

It is possible to send email in a freemarker template ?

Thank
9年前 に Etienne Roy によって更新されました。

RE: Send email in Freemarker Template

Regular Member 投稿: 114 参加年月日: 13/08/08 最新の投稿
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
9年前 に Cody Hoag によって更新されました。

RE: Send email in Freemarker Template

Junior Member 投稿: 70 参加年月日: 12/04/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
9年前 に Olaf Kock によって更新されました。

RE: Send email in Freemarker Template

Liferay Legend 投稿: 6403 参加年月日: 08/09/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)