【问题标题】:How to suppress multiple email notification from javascript如何抑制来自javascript的多个电子邮件通知
【发布时间】:2014-03-26 07:19:18
【问题描述】:

这是我的java脚本

var siteGroup = "GROUP_EMAIL_CONTRIBUTORS";
var mail = actions.create("mail");
mail.parameters.to_many = siteGroup;
var url = "Click http://pc1:8080/share/page/site/" + document.properties.name + "/dashboard" + "   to join the site";
mail.parameters.subject="New Site Created in Community";
mail.parameters.text=url;
//execute action against a document
mail.execute(document);

siteGroup 有三个成员,三个不同的电子邮件地址。问题是这个 java 脚本正在向所有三个用户发送三个电子邮件通知。如果我再添加一个成员,那么每个成员都会收到四封电子邮件。如何抑制这个?

【问题讨论】:

    标签: javascript email alfresco alfresco-share


    【解决方案1】:

    您需要创建 st:site 的子类型以确保它仅在站点上触发。

    有两种选择:

    1. 更改您的 email.js,使其检查文档类型是否为 st:site
    2. here 描述了一种更好的方法,您可以将 st:site 作为子类型添加到 share-config-custom.xml 中,以便在默认文件夹和内容类型旁边的下拉列表中选择它

    例如,这个 sn-p 需要在 de alfresco-config 标签之间:

    <config evaluator="string-compare" condition="DocumentLibrary">
            <types>
                 <type name="cm:folder">
                    <subtype name="st:site" />
                </type> 
            </types>
        </config> 
    

    【讨论】:

    • 这样对吗?? &lt;types&gt; &lt;type name="cm:content"&gt; &lt;subtype name="st:site" /&gt; &lt;/type&gt; &lt;type name="cm:folder"&gt; &lt;subtype name="st:site" /&gt; &lt;/type&gt; &lt;/types&gt;
    • 不,st:site 是 cm:folder 的子类型,而不是 cm:content 的子类型;)
    • 现在..&lt;types&gt; &lt;type name="cm:folder"&gt; &lt;subtype name="st:site" /&gt; &lt;/type&gt; &lt;/types&gt;
    • 我在 share-cofig-custom.xml 中添加了上述代码,但在默认文件夹和内容类型旁边没有下拉菜单
    • 我也可以在我的 java 脚本中使用这个 var doc = search.findNode("workspace://SpacesStore/eafb46a7-a139-42e1-b297-71402d279b68"); mail.execute(doc); 吗??
    猜你喜欢
    • 1970-01-01
    • 2017-10-10
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2019-06-08
    • 1970-01-01
    • 2014-06-05
    • 1970-01-01
    相关资源
    最近更新 更多