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函數的參數?