Alfresco - 将收件人姓名添加到工作流通知电子邮件模板 [英] Alfresco - add recipient's name to workflow notification email template

查看:28
本文介绍了Alfresco - 将收件人姓名添加到工作流通知电子邮件模板的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用的是 Alfresco 5.2 社区.我正在尝试编辑在 Repository> 中找到的模板 wf-email.html.ftl 文件.数据字典>电子邮件模板>工作流通知>wf-email.html.ftl.

I'm using Alfresco 5.2 Community. I'm trying to edit the template wf-email.html.ftl file found in Repository> Data Dictionary> Email Templates> Workflow Notification> wf-email.html.ftl.

在线

<p>Hi,</p>

我想在消息中添加收件人的姓名,例如

I want to add the recipient's name in the message, something like

<p>Hi John,</p>

这可能吗?如果是,是如何实现的?

Is this possible? If yes, how is it achieved?

推荐答案

不幸的是,受让人没有作为参数传递给模板,因此它对模板不可用.您可以通过查看实际发送通知的类的来源来看到这一点:

Unfortunately, the assignee is not passed as an argument to the template, so it is not available to the template. You can see this by looking at the source of the class that actually sends the notification:

https://github.com/Alfresco/alfresco-repository/blob/master/src/main/java/org/alfresco/repo/workflow/WorkflowNotificationUtils.java

查看该类,您可以看到工作流 ID、标题和描述等内容被添加为传递给模板渲染器的参数:

Looking at that class you can see where things like the workflow ID, title, and description are added as arguments that get passed to the template renderer:

    templateArgs.put(ARG_WF_ID, taskId);
    templateArgs.put(ARG_WF_TITLE, taskTitle);
    templateArgs.put(ARG_WF_DESCRIPTION, description);

但是受让人没有通过.

您可以查找工作流,然后获取当前任务,然后将受让人分配给该任务,但这可能不是最好的方法.

You could lookup the workflow and then get the current task and then get the assignee to that task, but that's probably not the best way to go about it.

如果你真的需要这个,我会用我自己的扩展现有的 WorkflowNotificationUtils.java,并将受让人作为参数添加到模板中.或者我会关闭默认通知,只使用我的自定义工作流程调用的我自己的通知类.

If you really need this, I would extend the existing WorkflowNotificationUtils.java with my own, and add in the assignee as an argument to the template. Or I'd turn off the default notifications and just use my own notification classes that my custom workflows call.

这篇关于Alfresco - 将收件人姓名添加到工作流通知电子邮件模板的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆