I'm using the VelocityEmail class with Turbine 2.3. My code works fine in that the template file is read and sent, however the Velocity variables are not being parsed:



                        log.debug("create velocity email object");
                        VelocityEmail email = new VelocityEmail();

                        context.put("message",((Email)email));
                        
                        context.put("gabba",new String("gabbahey"));                   
             
                        
                        
                        log.debug("set to name: " + group.get("FullName"));
                        log.debug("set to email: " + group.get("Email"));
                        email.addTo(group.get("Email").toString(),
                                group.get("FullName").toString());

log.debug("set from email: " + config.getString("project.email.global.from.email"));
log.debug("set from name: " + config.getString("project.email.global.from.name"));
email.setFrom(config.getString("project.email.global.from.email"),
config.getString("project.email.global.from.name"));


email.setSubject(group.get("Subject").toString());


                        
                        email.setContext(context);

                        email.setTemplate("app/emails/contact.vm");   
                
                        
                        email.send();


I've even tried to run the simple example listed in the JavaDocs for VelocityEmail and it didn't work either (the email sent, but the Velocity variables did not parse):



VelocityEmail ve = new VelocityEmail(); ve.setTo("Jon Stevens", "[EMAIL PROTECTED]"); ve.setFrom("Mom", "[EMAIL PROTECTED]").setSubject("Eat dinner"); ve.setContext(context); ve.setTemplate("app/emails/contact.vm"); ve.send();


I appreciate any help you provide.


Thanks
 - Matt


--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]



Reply via email to