2012-08-16 24 views
0

我可以發送有關新評論的通知,但我想將評論作爲電子郵件的一部分發送。這是我到目前爲止:如何在Liferay 6.1的Kaleo Workflow中將電子郵件發送到博客和頁面評論?

<notification> 
    <name>Notification</name> 
    <description>Notifies about new blog or page comments</description> 
    <template> 

    <![CDATA[ 
    <p> 
    There's a new comment at page ${page_url} by ${user_name} : 
    <#if comment != "" > 
    <br /><strong>${comment}</strong> 
    </#if> 
    </p> 

    <p>With Love,<br /><strong>Liferay</strong></p> 

    ]]> 

    </template> 
    <template-language>freemarker</template-language> 
    <notification-type>email</notification-type>    
    <recipients> 
     <role> 
      <role-type>regular</role-type> 
      <name>Portal Content Reviewer</name> 
      <auto-create>false</auto-create> 
     </role> 
    </recipients> 
    <execution-type>onEntry</execution-type> 
</notification> 

我該如何分配$ {page_url},$ {user_name}和$ {comment}?

回答

0

好吧,$ serviceContext有我需要的一切。請注意,我將模板語言更改爲速度。例如:

<template> 

<![CDATA[ 
## All attributes 
##set ($debug = ${serviceContext.getAttributes()}) 
## URL to page: 
#set ($url = ${serviceContext.getAttribute("contentURL")}) 
##Latest comment 
#set ($body = ${serviceContext.getAttribute("body")}) 
<p> 
There's a new comment at page $url : 
<br /><strong>$body</strong> 
</p> 
]]> 

</template> 
相關問題