Hi,
I am want to replace Alfresco in OOTB email templates with my custom name let say ABC.
As I might need to do for many clients, replacing Alfresco from all the email templates every time for each client doesn't seems feasible, hence I want to replace it with an object that can be used as placeholder for the clients name similar to shareUrl object in the email templates
E.g.
in following-email.html.ftl we have a line Sincerely Alfresco I want replace it with Sincerely ${myObject} this myObject will contain the name of the client ABC.
myObject value will be defined in alfresco-global.propsand the templates will be bootstrapped using ImportComponentModule.
Thanks
Hiten Rastogi
This is sample script code to send email.
var mail = actions.create("mail");
mail.parameters.to_many = "user_email";
mail.parameters.subject = "Notification review";
mail.parameters.template = companyhome.childByNamePath("Data Dictionary/EMail Templates/Email_Templates.ftl");
var templateArgs = new Array();
templateArgs['name'] = person.properties.firstName+" "+person.properties.lastName;
var templateModel = new Array();
templateModel['args'] = templateArgs;
mail.parameters.template_model = templateModel;
mail.executeAsynchronously(person);
And this is email template file place this file under the path Data Dictionary/EMail Templates/Email_Templates.ftl
<html>
<head>
</head>
<body bgcolor="white">
<div>
<p>Hi <b>${args.name},</b></p>
</div>
</body>
</html>
companyhome.childByNamePath("Data Dictionary/EMail Templates/Email_Templates.ftl");
This path defines the location of your email template.
We need to pass templateArgs array values to template_model.
Thanks,
Kalpesh
Hi Kaplesh,
Thanks for your response but what I am seeking is an object that is similar to shareUrl that can contain my value and can be used in any email templates without worrying to passing it in the template model every time.
Thanks
I was able to achieve this by using message object.
Putting this ${message("client.name")} in the email templates helped me picked up the value for the labels from my properties file in the repo.
Thanks
Ask for and offer help to other Alfresco Content Services Users and members of the Alfresco team.
Related links:
By using this site, you are agreeing to allow us to collect and use cookies as outlined in Alfresco’s Cookie Statement and Terms of Use (and you have a legitimate interest in Alfresco and our products, authorizing us to contact you in such methods). If you are not ok with these terms, please do not use this website.