}
}
EnvironmentImpl environment = EnvironmentImpl.getCurrent();
IdentitySession identitySession = environment.get(IdentitySession.class);
AddressResolver addressResolver = environment.get(AddressResolver.class);
// resolve and tokenize users
String userList = addressTemplate.getUsers();
if (userList != null) {
String[] userIds = tokenizeActors(userList, execution);
List<User> users = identitySession.findUsersById(userIds);
addRecipients(resolveAddresses(users, addressResolver), email, recipientType);
}
// resolve and tokenize groups
String groupList = addressTemplate.getGroups();
if (groupList != null) {
for (String groupId : tokenizeActors(groupList, execution)) {
Group group = identitySession.findGroupById(groupId);
addRecipients(addressResolver.resolveAddresses(group), email, recipientType);
}
}
}