This content has been marked as final.
Show 7 replies
-
1. Re: Event for each mail during multiple message session
pmuir Jan 8, 2008 6:27 AM (in response to terryb)How do you send the emails?
-
2. Re: Event for each mail during multiple message session
terryb Jan 8, 2008 7:10 AM (in response to terryb)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@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>
-
3. Re: Event for each mail during multiple message session
pmuir Jan 8, 2008 8:13 AM (in response to terryb)We could add an event for you to observe. Do you need the details of the mail sent?
-
4. Re: Event for each mail during multiple message session
terryb Jan 8, 2008 8:38 AM (in response to terryb)yes please, event for sure. if some email details can be accessed that would be good too though it is not required for this task.
-
5. Re: Event for each mail during multiple message session
christian.bauer Jan 8, 2008 8:40 AM (in response to terryb)What's wrong with:
renderer.render(mailTemplate);
Events.instance().raiseEvent("MyEvent", myPayload); -
6. Re: Event for each mail during multiple message session
pmuir Jan 8, 2008 9:01 AM (in response to terryb)OP asked
is it possible to capture event after each individual mail is sent?
which as he's using a ui:repeat would only produce one event per batch. -
7. Re: Event for each mail during multiple message session
terryb Jan 8, 2008 9:09 AM (in response to terryb)my application will be sending thousands of emails, I thought ui:repeat would be faster than calling a renderer.render(mailTemplate) for each email. if this is true, then I guess having an event is good.