Email Alfresco-使用电子邮件通知模板无法正常工作
我使用的是开箱即用的Alfresco 4.2.f,没有定制,我试图设置电子邮件通知是否在某个文件夹中添加了新文档。 因此,我在文件夹中添加了一条规则,并使用“notify\u user\u email\u it.html.ftl”作为模板将“发送电子邮件”设置为执行操作。 如果我插入文档,我不会收到电子邮件,以下是日志中的错误:Email Alfresco-使用电子邮件通知模板无法正常工作,email,alfresco,alfresco-share,Email,Alfresco,Alfresco Share,我使用的是开箱即用的Alfresco 4.2.f,没有定制,我试图设置电子邮件通知是否在某个文件夹中添加了新文档。 因此,我在文件夹中添加了一条规则,并使用“notify\u user\u email\u it.html.ftl”作为模板将“发送电子邮件”设置为执行操作。 如果我插入文档,我不会收到电子邮件,以下是日志中的错误: Expression person is undefined on line 38, column 57 in workspace://SpacesStore/5508
Expression person is undefined on line 38, column 57 in workspace://SpacesStore/55088e2c-05ac-4264-8396-ee6f3c7021ad.
The problematic instruction:
----------
==> ${person.properties.firstName} [on line 38, column 55 in workspace://SpacesStore/55088e2c-05ac-4264-8396-ee6f3c7021ad]
----------
如果我从模板中删除字符串${person.properties.firstName},那么规则可以正常工作,但是我收到的邮件不是预期的,所有有趣的信息都显示在原始FTL中。附上收到的电子邮件,以便更好地理解
真的很奇怪,因为我没有自定义任何东西,也许这是一个错误,但我没有找到任何关于吉拉。。。
有人有同样的行为?可能的解决办法
提前谢谢!
根据这一点,这并不是一个真正的bug,只是对管理员用户不起作用。
你有没有试过用普通用户
---更新---
可能是因为它的错误或未实现的功能,如以下内容在模板中修复它:
<#if person??>
.... set your person properties first & lastname
<#else>
.... is sure to be admin, so set the admin
</#if>
.... 将个人属性设置为first&lastname
.... 肯定是admin,所以设置admin
您必须将参数传递给电子邮件模板
你可以试试这个例子
var template = "Data Dictionary/Email Templates/Workflow Notification/<<Your File>>.html.ftl";
var mail = actions.create("mail");
mail.parameters.to = "xyx@gmail.com";
mail.parameters.subject="Hello";
mail.parameters.text="blablabla";
mail.parameters.template = companyhome.childByNamePath(template);
var templateArgs = new Array();
templateArgs['workflowTitle'] = "789789";
templateArgs['workflowDescription'] = "879789";
templateArgs['workflowId'] = "879789";
var templateModel = new Array();
templateModel['args'] = templateArgs;
mail.parameters.template_model = templateModel;
mail.execute(bpm_package);
var template=“数据字典/电子邮件模板/工作流通知/.html.ftl”;
var mail=actions.create(“邮件”);
mail.parameters.to=”xyx@gmail.com";
mail.parameters.subject=“Hello”;
mail.parameters.text=“blabla”;
mail.parameters.template=companyhome.childByNamePath(模板);
var templateArgs=新数组();
templateArgs['workflowTitle']=“789789”;
templateArgs['workflowDescription']=“879789”;
templateArgs['workflowId']=“879789”;
var templateModel=新数组();
templateModel['args']=templateArgs;
mail.parameters.template_model=templateModel;
mail.execute(bpm_包);
然后你可以在你的电子邮件模板ftl文件中使用${args.workflowTitle}获取参数谢谢,我没有找到Jira,但这确实是我所说的……我不明白:我是作为非管理员用户创建规则还是我必须将电子邮件发送到非管理员用户的地址?!规则可以创建为admin,它不在那里存储person属性。只需将邮件发送给任何人,仅以非管理员用户的身份添加新文档。因此,模板现在将成为person对象。您不认为可以在代码中验证表达式,如果未定义,则将其设置为泛型“user”或字符串吗?我假设当您发送邮件时,您不会像上面的示例那样传递参数;因此,您可能会遇到错误