I have an asynchronus method sending emails, but I can't get any values to work 
due to EL-exceptions.

My class:

  | @Name("emailProcessor")
  | @AutoCreate
  | public class EmailProcessor {
  | 
  |     @Asynchronous
  |     @Transactional
  |     public QuartzTriggerHandle scheduleSend(@Expiration Date endDate, 
Company company) {
  |              for(Person p : company.getPersons()){
  |                                 try {
  |                                     
renderer.render("/mails/reminder.xhtml");
  |                                     log.debug("Email sent successfully");
  |                                 } 
  |                                 catch (Exception e) {
  |                                     log.debug("Email sending failed: " + 
e.getMessage());
  |                                     e.printStackTrace();
  |                                 }
  | 
  | 
  |              }
  | 
  |         }
  | 
  | }
  | 


And my XHTML-file:
<m:message xmlns="http://www.w3.org/1999/xhtml";
  |     xmlns:m="http://jboss.com/products/seam/mail";
  |     xmlns:h="http://java.sun.com/jsf/html";>
  |   
  |     <m:from name="Påminnelsemailet" address="admin at two.se" />
  |     <m:to name="{p.fullName}">{p.email}</m:to>
  |     <m:subject>Glöm inte. . .</m:subject>
  |     
  |     <m:body>
  |         <p><h:outputText value="Hej {p.name}"/>,<br/>
  |            Glöm inte att ...
  |         </p>
  |     </m:body>
  |     
  | </m:message>

If I cut out the EL-expressions, the mails are sent successfully.
I'm not quite sure how to outject the persons to be able to send the mails, 
anyone got an idea?

I probably get an RTFM on this one, but I got stuck on this...

View the original post : 
http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4074418#4074418

Reply to the post : 
http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4074418

_______________________________________________
jboss-user mailing list
[email protected]
https://lists.jboss.org/mailman/listinfo/jboss-user

Reply via email to