If you have a bit influence how ACL entries are look like then you should be able to achieve a good solution. Following code collects all entries in ACL with the certain role and accepts only those entries which are of type Person
or Person group
.
Function GetRoleMembers(roleName As String) As String
Dim session As New NotesSession
Dim db As NotesDatabase
Dim acl As NotesACL
Dim entry As NotesACLEntry
Dim sMembers As String
Set db = session.CurrentDatabase
Set acl = db.ACL
sMembers = ""
Set entry = acl.GetFirstEntry
While Not ( entry Is Nothing )
If entry.IsRoleEnabled( roleName ) And entry.IsPerson Then
sMembers = sMembers + entry.Name & ","
End If
Set entry = acl.GetNextEntry( entry )
Wend
GetRoleMembers = sMembers
End Function
The Function returns a comma separated list of all persons and groups with given role. You can test this function with
Print GetRoleMembers("[Test]")
Make sure that users whom you want to send emails are assigned to type Person
or Person group
. You can set user's type in ACL
