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

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

问题描述

我正在使用Alfresco 5.2社区.我正在尝试编辑在存储库>中找到的模板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天全站免登陆