Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
Clear All
new posts

    usage of $servletRequest doesn't work? (velocity mail template)

    Hello,

    Using Power, 06-30-2011.

    Hello, upon insertion of a row, I want to send an email. Somehow I get this warning:
    Code:
    === 2011-07-08 16:00:26,603 [l0-6] WARN  DSRequest - Encountered non-Map object [$servletRequest.getAttribute("mailData")] while processing email definitions
    Here is my operationbinding:
    Code:
    <mail> 
      <from>noreply@xyz.nl</from>  
      <to>$email</to>  
      <templateFile>emailtemplates/technicom_user_subscribes_student.txt</templateFile>  
      <subject>Bla Blah</subject> 
      <messageData>$servletRequest.getAttribute("mailData")</messageData>
    </mail>
    And here is the map that I am setting in the request. It is needed because it fetches some data from different datasources.
    Code:
    Map mailData= new HashMap();
    mailData.put("courseName",courseName);
    mailData.put("courseEditionName", cedName);
    mailData.put("firstname", (String) req.getFieldValue("firstname"));
    mailData.put("tussenvoegsel", (String) req.getFieldValue("tussenvoegsel"));
    mailData.put("surname", (String) req.getFieldValue("surname"));
    
    req.getServletContext().setAttribute("mailData",mailData);
    
    // this triggers the email
    DSResponse enroll =  req.execute();
    Any idea or hint what this velocity expression should be?

    Thanks in advance!
    Last edited by Sytematic; 8 Jul 2011, 06:18.

    #2
    You seem to be setting an attribute on the ServletContext, but attempting to access it on the servletRequest.

    Comment


      #3
      Doh, makes sense. Thanks. More caffeine :-)

      Comment

      Working...
      X