From aabb4140d632929701cf4d7918f4e70bc9b448e0 Mon Sep 17 00:00:00 2001 From: nidhigarg-bmw <101316912+nidhigarg-bmw@users.noreply.github.com> Date: Fri, 15 Mar 2024 22:46:52 +0530 Subject: [PATCH] feat(email template): content changes in new user external idp file (#537) * feat(email template): textual changes in new user external idp file * feat(new user account email): rename filename * feat(mailing): add idpAlias parameter for template NewUserExternalIdpTemplate --------- Co-authored-by: Norbert Truchsess --- .../BusinessLogic/UserBusinessLogic.cs | 3 ++- .../BusinessLogic/UserUploadBusinessLogic.cs | 5 ++++- ...dp.html => new_user_account_external_idp.html} | 15 +++++++++++---- .../Mailing.Template/Enums/EmailTemplateType.cs | 6 +++--- src/processes/Processes.Worker/appsettings.json | 7 +++++++ 5 files changed, 27 insertions(+), 9 deletions(-) rename src/mailing/Mailing.Template/EmailTemplates/{new_user_account_ownidp.html => new_user_account_external_idp.html} (95%) diff --git a/src/administration/Administration.Service/BusinessLogic/UserBusinessLogic.cs b/src/administration/Administration.Service/BusinessLogic/UserBusinessLogic.cs index de54a5bf08..5a4752a34a 100644 --- a/src/administration/Administration.Service/BusinessLogic/UserBusinessLogic.cs +++ b/src/administration/Administration.Service/BusinessLogic/UserBusinessLogic.cs @@ -198,11 +198,12 @@ public async Task CreateOwnCompanyIdpUserAsync(Guid identityProviderId, Us { "companyName", displayName }, { "nameCreatedBy", nameCreatedBy }, { "url", _settings.Portal.BasePortalAddress }, + { "idpAlias", displayName }, }; var mailTemplates = companyNameIdpAliasData.IsSharedIdp ? new[] { "NewUserTemplate", "NewUserPasswordTemplate" } - : new[] { "NewUserOwnIdpTemplate" }; + : new[] { "NewUserExternalIdpTemplate" }; if (companyNameIdpAliasData.IsSharedIdp) { diff --git a/src/administration/Administration.Service/BusinessLogic/UserUploadBusinessLogic.cs b/src/administration/Administration.Service/BusinessLogic/UserUploadBusinessLogic.cs index c09b290f9f..13cde28f70 100644 --- a/src/administration/Administration.Service/BusinessLogic/UserUploadBusinessLogic.cs +++ b/src/administration/Administration.Service/BusinessLogic/UserUploadBusinessLogic.cs @@ -129,6 +129,8 @@ await GetUserRoleDatas(parsed.Roles, validRoleData, _identityData.CompanyId).Con UserCreationRoleDataIdpInfo? userCreationInfo = null; + var displayName = await _userProvisioningService.GetIdentityProviderDisplayName(companyNameIdpAliasData.IdpAlias).ConfigureAwait(false); + await foreach (var result in _userProvisioningService .CreateOwnCompanyIdpUsersAsync( @@ -157,8 +159,9 @@ await GetUserRoleDatas(parsed.Roles, validRoleData, _identityData.CompanyId).Con { KeyValuePair.Create("nameCreatedBy", nameCreatedBy), KeyValuePair.Create("url", _settings.Portal.BasePortalAddress), + KeyValuePair.Create("idpAlias", displayName) }); - _mailingProcessCreation.CreateMailProcess(userCreationInfo.Email, "NewUserOwnIdpTemplate", mailParameters); + _mailingProcessCreation.CreateMailProcess(userCreationInfo.Email, "NewUserExternalIdpTemplate", mailParameters); yield return (result.CompanyUserId, result.UserName, result.Password, null); } diff --git a/src/mailing/Mailing.Template/EmailTemplates/new_user_account_ownidp.html b/src/mailing/Mailing.Template/EmailTemplates/new_user_account_external_idp.html similarity index 95% rename from src/mailing/Mailing.Template/EmailTemplates/new_user_account_ownidp.html rename to src/mailing/Mailing.Template/EmailTemplates/new_user_account_external_idp.html index c69603b9eb..14525adb7c 100644 --- a/src/mailing/Mailing.Template/EmailTemplates/new_user_account_ownidp.html +++ b/src/mailing/Mailing.Template/EmailTemplates/new_user_account_external_idp.html @@ -96,13 +96,20 @@

- You can directly login to the Catena-X Portal by clicking on the “Login” button. -
Your Organization uses Single Sign-On (SSO) to login to the Catena-X core - services and business applications. + You can directly login to the Catena-X Portal by clicking on the “Login” button below.

- By clicking on "Join Now" you can directly login via your company SSO.

+ When reaching the login page, you get asked to select your company tenant. Please use therefore the following tenant:

{idpAlias}

* which will automatically forward you to the SSO page. +

+

+ Your Organization uses Single Sign-On (SSO) to login to the Catena-X core services and business applications. +

+

+ By clicking on "Join Now" you can directly login by using your company login data. +

- /// Email template for new users being created on own idp + /// Email template for new users being created on external idp /// - [Path("new_user_account_ownidp.html")] - NewUserAccountOwnIdp, + [Path("new_user_account_external_idp.html")] + NewUserAccountExternalIdp, /// /// Email template for credential approvals diff --git a/src/processes/Processes.Worker/appsettings.json b/src/processes/Processes.Worker/appsettings.json index c5255d579c..e5bb433c85 100644 --- a/src/processes/Processes.Worker/appsettings.json +++ b/src/processes/Processes.Worker/appsettings.json @@ -469,6 +469,13 @@ "EmailTemplateType": "Password" } }, + { + "Name": "NewUserExternalIdpTemplate", + "Setting": { + "Subject": "", + "EmailTemplateType": "NewUserAccountExternalIdp" + } + }, { "Name": "EmailRegistrationDeclineTemplate", "Setting": {