I prepare a list of recipients and use template below. then in bean use
renderer.render(mailTemplate);
| mail-message.xhtml
| <ui:composition
xmlns="http://www.w3.org/1999/xhtml"
|
xmlns:ui="http://java.sun.com/jsf/facelets"
|
xmlns:h="http://java.sun.com/jsf/html"
|
xmlns:f="http://java.sun.com/jsf/core"
|
xmlns:s="http://jboss.com/products/seam/taglib"
|
xmlns:m="http://jboss.com/products/seam/mail"
| importance="normal">
|
| <ui:repeat value="#{subscription.mailingList}"
var="recipient">
| <m:message>
| <m:from name="xyz" address="xyz(a)abc.com" />
| <m:to name="#{recipient[0]}">#{recipient[1]}</m:to>
|
<m:subject>#{subscription.subscriptionConfig.massMailSubject}</m:subject>
| <m:body>
| <html>
| <body>
| <h:outputText
value="#{subscription.massMailMessage}" escape="false"/>
| </body>
| </html>
| <f:facet name="alternative">
| <h:outputText>
| Sorry, your mail reader doesn't support HTML...
| </h:outputText>
| </f:facet>
| </m:body>
| </m:message>
| </ui:repeat>
| </ui:composition>
|
View the original post :
http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4117877#...
Reply to the post :
http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&a...