1
我是新来的Alfresco(第4版),我想(实际上lib.js)创建webscript用于发送具有功能与以下签名的电子邮件:如何发送电子邮件在露天4
function sendMail(to, subject, templatePath, templateArgs)
这函数会在满足一些条件时从其他web脚本中调用。我发现这样的脚本:
var mail = actions.create("mail");
mail.parameters.to = "[email protected]";
mail.parameters.subject = "Test subject";
mail.parameters.template = companyhome.childByNamePath("Data Dictionary/Email Templates/Workflow Notification/wf-email.html.ftl");
var templateArgs = new Array();
templateArgs['workflowTitle'] = "workflowTitle";
templateArgs['workflowPooled'] = true;
templateArgs['workflowDescription'] = "workflowDesc";
templateArgs['workflowId'] = "workflowId";
var templateModel = new Array();
templateModel['args'] = templateArgs;
mail.parameters.template_model = templateModel;
mail.execute(search.findNode("workspace://SpacesStore/9e15aaac-b30b-4266-984f-21fe273a6113"));
,但我不知道如何把它在我的代码,因为我不知道三两件事:
我可以在使用此代码我的场景,即使js lib可以导入并用于发送各种电子邮件?
如果可以,我在哪里可以找到对动作的引用(在文件开始时导入什么内容)?
我应该把什么作为mail.execute函数的参数?