public async Task <Either <ActionResult, PreReleaseUserInvitePlan> > GetPreReleaseUsersInvitePlan(
            Guid releaseId,
            List <string> emails)
        {
            return(await _persistenceHelper.CheckEntityExists <Release>(releaseId)
                   .OnSuccess(_userService.CheckCanAssignPrereleaseContactsToRelease)
                   .OnSuccess(release => EmailValidator.ValidateEmailAddresses(emails))
                   .OnSuccess <ActionResult, List <string>, PreReleaseUserInvitePlan>(async validEmails =>
            {
                var plan = new PreReleaseUserInvitePlan();
                await validEmails
                .ToAsyncEnumerable()
                .ForEachAwaitAsync(async email =>
                {
                    if (await _userReleaseRoleRepository
                        .HasUserReleaseRole(email, releaseId, PrereleaseViewer))
                    {
                        plan.AlreadyAccepted.Add(email);
                    }
                    else
                    {
                        if (await _userReleaseInviteRepository
                            .UserHasInvite(releaseId, email, PrereleaseViewer))
                        {
                            plan.AlreadyInvited.Add(email);
                        }
                        else
                        {
                            plan.Invitable.Add(email);
                        }
                    }
                });

                if (plan.Invitable.Count == 0)
                {
                    return ValidationActionResult(NoInvitableEmails);
                }

                return plan;
            }));
        }