StringWriter email_body = new StringWriter();
Context emailContext = TurbineVelocity.getContext(data);
SimpleEmail se = new SimpleEmail();
emailContext.put( "data", data );
emailContext.put( "user", user );
emailContext.put("config",new JetspeedResources());
emailContext.put("urltojetspeed",url);
emailContext.put("email",se);
String templateFile = JetspeedResources.getString("newuser.confirm.email.template");
String templatePath = TemplateLocator.locateEmailTemplate(data, templateFile);
TurbineVelocity.handleRequest(emailContext, templatePath, email_body);