.addQueryData("mode","update");
try
{
//build body via template
StringWriter email_body = new StringWriter();
SimpleEmail se = new SimpleEmail();
Context emailContext = TurbineVelocity.getContext();
emailContext.put( "data", data );
emailContext.put( "user", user );
emailContext.put( "config",new JetspeedResources());
emailContext.put( "userurl",url);
emailContext.put( "email",se);
//determine the language to be used for the notification email
String language = JetspeedResources.getString("newuser.notification.language","en");
String country = JetspeedResources.getString("newuser.notification.country","US");
Locale locale = new Locale(language,country);
String templateFile = JetspeedResources.getString("newuser.notification.email.template");
String templatePath = TemplateLocator.locateEmailTemplate(data, templateFile, locale);
TurbineVelocity.handleRequest(emailContext, templatePath, email_body);
se.setMsg(email_body.toString());
Properties props = System.getProperties();
String mailServerMachine = JetspeedResources.getString( "mail.server" );
props.put ( "mail.host", mailServerMachine );
props.put("mail.smtp.host", mailServerMachine);
se.send();
data.setMessage (CustomLocalization.getString("SENDCONFIRMATIONEMAIL_SENT", data));
} catch ( Exception e )
{
String errorTitle = CustomLocalization.getString("SENDCONFIRMATIONEMAIL_ERROR", data) ;