private async Task <List <int> > GetPartipantDetailsFromGroup(MessageParticipant messageParticipant) { if (messageParticipant.GroupRoleType != null && messageParticipant.GroupRoleType.GroupId.HasValue) { var users = await _connectGroupService.GetGroupMembersForGivenRole ( messageParticipant.GroupRoleType.GroupId.Value, messageParticipant.GroupRoleType.GroupRoles ); return(users); } else { return(null); } }
public async Task <List <SendMessageRequest> > IdentifyRecipients(int?recipientUserId, int?jobId, int?groupId, int?requestId, Dictionary <string, string> additionalParameters) { if (!groupId.HasValue || !requestId.HasValue) { throw new Exception($"GroupID or RequestID are missing"); } List <int> groupTaskAdmins = await _connectGroupService.GetGroupMembersForGivenRole(groupId.Value, GroupRoles.TaskAdmin); foreach (int userId in groupTaskAdmins) { _sendMessageRequests.Add(new SendMessageRequest() { TemplateName = TemplateName.NewTaskPendingApprovalNotification, RecipientUserID = userId, GroupID = groupId, JobID = null, RequestID = requestId, }); } return(_sendMessageRequests); }