private async Task <Guid> CreateOutlookMeeting( CreateInvitationCommand request, IReadOnlyCollection <BuilderParticipant> meetingParticipants, Invitation invitation) { foreach (var meetingParticipant in meetingParticipants) { _logger.LogInformation($"Adding {meetingParticipant.Person.AzureUniqueId} - {meetingParticipant.Person.Mail} to invitation {invitation.Id}"); } var organizer = await _personRepository.GetByOidAsync(_currentUserProvider.GetCurrentUserOid()); var meeting = await _meetingClient.CreateMeetingAsync(meetingBuilder => { var baseUrl = InvitationHelper.GetBaseUrl(_meetingOptions.CurrentValue.PcsBaseUrl, _plantProvider.Plant); meetingBuilder .StandaloneMeeting(InvitationHelper.GenerateMeetingTitle(invitation), request.Location) .StartsOn(request.StartTime, request.EndTime) .WithTimeZone("UTC") .WithParticipants(meetingParticipants) .WithClassification(MeetingClassification.Open) .EnableOutlookIntegration() .WithInviteBodyHtml(InvitationHelper.GenerateMeetingDescription(invitation, baseUrl, organizer)); }); return(meeting.Id); }