AnsweredAssumed Answered

Pass parameters email template

Question asked by afistolao on Mar 15, 2010
Latest reply on Jul 29, 2010 by lucille.arkenstone
hi,
i have defined a web script wich send an email using a template to populate the body. The web script works, but i need to pass parameters to the template, i have tried using the model variable in the javascript but it doesn´t work.
Somebody can help me?
This is the javascript code for the web script
ç
script:
{
   var mail = actions.create("mail");
   var objeto = args.email;
   var jsonMail = eval("("+objeto+")");
   mail.parameters.to = jsonMail.to;
   mail.parameters.subject = jsonMail.subject;
   mail.parameters.from = jsonMail.from;
   var mailSubject = mail.parameters.subject;
   logger.log("mailSubject: " + mailSubject);
   model.formTitle=jsonMail.title;
   model.datos=jsonMail.fields;
   mail.parameters.template = companyhome.childByNamePath("Data Dictionary/Email Templates/plantilla.ftl");
   mail.parameters.loquesae = jsonMail.fields;
   var mailMatter = mail.parameters.text;
   mail.parameters.text = "Correo con asunto: "+jsonMail.subject;
   mail.execute(mail.parameters.template);
   model.res=jsonMail.to;
   model.email=objeto;
}

Thanks!!!

Outcomes