private void SendNotificationToLegalOfficers(OrganizationLicense license, List <User> legalOfficers, string schemaName, string urlToSchema, LoggedInUserDetails user) { // Send notification to legal officers foreach (var legalOfficer in legalOfficers) { // Generate secure token var tokenInfo = _tokens.GenerateLicenseVerificationToken(legalOfficer.ID, license.ID); // Create approval request var request = new LicenseApprovalRequest { accessToken = tokenInfo.TokenInfoEncoded, Token = tokenInfo.Token, ExpiresAt = tokenInfo.TokenExpire.Value, OrganizationLicenseID = license.ID, SentAt = GetDate, SentBy = user.ID.Value, SentTo = legalOfficer.ID }; // Save request _verificationRequests.Add(request); // Setup url to confirmation screen var urlToConfirmScreen = _urls.ToLicenseVerification(license.ApplicationID, license.DataSchemaID, tokenInfo.TokenInfoEncoded); // Send notificaion to legal officer with templated license if (license.LicenseTemplateID != null) { // Send notification _notificationService.LegalOfficer.LicenseIsPendingApprovalInBackground(legalOfficer.ID, $"{urlToConfirmScreen}#Clauses", urlToSchema, _config.DataLinkerHost, schemaName, license.ID); } // Send notificaion to legal officer with custom license if (license.CustomLicenseID != null) { // Send notification _notificationService.LegalOfficer.LicenseVerificationRequiredInBackground(legalOfficer.ID, urlToConfirmScreen, schemaName, license.ID); } } }