cancel
Showing results for 
Search instead for 
Did you mean: 

Email notification: Alerting a subset of the principals?

Graham_Fawcett
Champ on-the-rise
Champ on-the-rise

The Create a task assignment alert tutorial presents a method for writing an automation chain that notifies the principals (users with a given permission) on a document under some condition. But I would like to only send emails to users who have opted into email notification. For example, an office manager may be a principal, but her delegate routinely processes this type of work, so only her delegate should receive notifications.

I was considering creating a group, "People who want Email Notifications," and taking the set-intersection of this group with the principals of the document. (In my example, the office manager and the delegate are both principals; but only the delgate is in the "Email" group.)

Is it possible, in Studio, to "filter" the set of principals using such a group? If not, do you have better suggestions for other ways to model opt-in/opt-out notifications?

1 ACCEPTED ANSWER

pibou_Bouvret
Elite Collaborator
Elite Collaborator

same as http://answers.nuxeo.com/questions/3049/how-to-exclude-administrator-from-documentgetusersandgroups-...

I built up the intersection using the run script operation :

Context["mail_to_read"]) = emails of "users with a given permission" including administrators

Context["mail_administrators"]) : emails of administrators

foreach ( mail_administrator : Context["mail_administrators"]) 
{
    if( Context["mail_to_read"].indexOf(mail_administrator) >= 0 )
    {
        Context["mail_to_read"].remove(Context["mail_to_read"].indexOf(mail_administrator));
    } 
}

and Context["mail_to_read"] has been cleaned up of the administrators

View answer in original post

2 REPLIES 2

pibou_Bouvret
Elite Collaborator
Elite Collaborator

same as http://answers.nuxeo.com/questions/3049/how-to-exclude-administrator-from-documentgetusersandgroups-...

I built up the intersection using the run script operation :

Context["mail_to_read"]) = emails of "users with a given permission" including administrators

Context["mail_administrators"]) : emails of administrators

foreach ( mail_administrator : Context["mail_administrators"]) 
{
    if( Context["mail_to_read"].indexOf(mail_administrator) >= 0 )
    {
        Context["mail_to_read"].remove(Context["mail_to_read"].indexOf(mail_administrator));
    } 
}

and Context["mail_to_read"] has been cleaned up of the administrators

Thank you! I'll give this a try.

Getting started

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.