d225f32a99713c53e8bb992e7438d0221870aab2
[Plinn.git] / skins / control / getRecipients.py
1 ##parameters=object=None
2 if object is None :
3 object = context
4 roles = context.valid_roles()
5
6 # todo : sort by role
7
8 recipientIds = []
9 rolesAndMembers = []
10 for role in roles :
11 membersInRole = []
12 for member in object.getAllMembersInRole(role) :
13 if (member.id not in recipientIds) and member.getProperty('email') :
14 membersInRole.append(member)
15 recipientIds.append(member.getId())
16 if membersInRole :
17 rolesAndMembers.append( (role, membersInRole) )
18
19 return rolesAndMembers