cancel
Showing results for 
Search instead for 
Did you mean: 

Javascript to send mails only to site managers

gmce
Confirmed Champ
Confirmed Champ
Hello everyone, i successfully created a javascript (triggered by rules) that sends mail notification to all site users.

var parent = space.getParent();
var siteShortName = space.getSiteShortName();
var siteGroup = "GROUP_site_" + siteShortName;

var template = "Dizionario dei dati/Modelli di e-mail/Modelli di e-mail di notifica/notifica_documento_aggiunto.html.txt";

// create mail action
var mail = actions.create("mail");
mail.parameters.to_many = siteGroup;

mail.parameters.subject="Nuovo Documento nel progetto " + siteShortName;
//mail.parameters.text="blablabla";
mail.parameters.template = companyhome.childByNamePath(template);

//execute action against a document
mail.execute(document);

Now i am trying to modify this script to send mails only to the managers of the site.
I've tried the function site.memberList(null,manager,null) but if i have understood correctly the result is a map and not an array.

Thanks in advance.

P.S. using Alfresco Community 4.0.d
2 REPLIES 2

billerby
Champ on-the-rise
Champ on-the-rise
You can address the mail to the manager group of the site ie:

var siteGroupManagers = "GROUP_site_" + siteShortName + "_SiteManager";

/Erik

gmce
Confirmed Champ
Confirmed Champ
Thank you very much.
It works perfectly.
Getting started

Tags


Find what you came for

We want to make your experience in Hyland Connect as valuable as possible, so we put together some helpful links.