Hello,
Thank you for your answers, , it was created as a simple two operations of sending notification - one email for manager and one email for administrators but supplier want to receive less emails and as an administrator want to see to who email is send, because sometimes email didn't came to manager and in logs there is no message why didn't came.
's working as I want :)
Here is the correct code:
//var role = addedRole.get();
var multiParticipants = new Array();
var ownerObj = owner.get();
var mailId = ownerObj.getProperty("mail")[0];
//var roleOwners = role.getProperty("ITIM Administrators")[0];
multiParticipants[0] = new Participant(ParticipantType.USER, "erglobalid=7415940384582509432,ou=0,ou=people,erglobalid=00000000000000000000,ou=cfp,DC=PL");
//activity.auditEvent("Dodano mail admin ITIM: " + roleOwners);
if((mailId != null) && (mailId != "") && (mailId.length > 0) && (typeof mailId != 'undefined')) {
//activity.auditEvent("Uzytkownik ma mail: " + mailId);
var ownerdn = ownerObj.getProperty("owner")[0];
multiParticipants[1] = new Participant(ParticipantType.USER, ownerdn);
} else {
var managerdn = ownerObj.getProperty("manager")[0];
var managerrb = ownerObj.getProperty("cfmanagerrb")[0];
multiParticipants[1] = new Participant(ParticipantType.USER, managerdn);
activity.auditEvent("User doesn't have an e-mail address, a new password will be sent to his supervisor: " + managerrb);
}
return multiParticipants;
And now email is sending to manager of user and administrator (to erglobalid of user I added group email of administrators)
#Support#SupportMigration#Verify