2014-03-26 29 views
2

這裏抑制多個電子郵件通知我的Java腳本如何從JavaScript

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腳本正在向所有三個用戶發送三個電子郵件通知。如果我再加一個會員,每個會收到四封電子郵件。如何抑制這一點?

enter image description here

enter image description here

+0

您錯過了一些信息。你的規則的配置是什麼?腳本正在執行3/4次,所以你需要檢查你的條件。 –

+0

@TahirMalik我添加了規則配置 – samnaction

回答

2

你需要創建ST的子類型:網站,以確保它僅觸發在網站上。

有2個選項:

  1. 更改email.js所以它會檢查文件類型爲ST:網站
  2. 一種更好的方式描述here,都可以添加ST:網站作爲一個子類型的共享配置,custom.xml所以它選擇在下拉列表旁邊的默認文件夾&內容類型

例子,這段代碼需要在德間alfresco-config標籤:

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

這是正確的? ' <類型名稱= 「釐米:內容」> <子類型名稱= 「ST:位點」/> <類型名稱= 「釐米:文件夾」> <子類型名稱= 「ST:位點」 /> ' – samnaction

+0

否,ST:網站是釐米的子類型:文件夾,並釐米的不:內容;) –

+0

Now..' <類型名稱= 「釐米:文件夾」> <子類型名稱= 「st:site」/> ' – samnaction