Skip to content

Commit

Permalink
feat(email template): content changes in new user external idp file (#…
Browse files Browse the repository at this point in the history
…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 <[email protected]>
  • Loading branch information
nidhigarg-bmw authored Mar 15, 2024
1 parent 7be06fc commit aabb414
Show file tree
Hide file tree
Showing 5 changed files with 27 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -198,11 +198,12 @@ public async Task<Guid> 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)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down Expand Up @@ -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);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -96,13 +96,20 @@
</p>
<p
style="Margin:0;-webkit-text-size-adjust:none;-ms-text-size-adjust:none;mso-line-height-rule:exactly;font-family:arial, 'helvetica neue', helvetica, sans-serif;line-height:21px;color:#333333;font-size:14px">
You can directly login to the Catena-X Portal by clicking on the “Login” button.
<br> 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.
</p>
<p
style="Margin:0;-webkit-text-size-adjust:none;-ms-text-size-adjust:none;mso-line-height-rule:exactly;font-family:arial, 'helvetica neue', helvetica, sans-serif;line-height:21px;color:#333333;font-size:14px">
By clicking on "Join Now" you can directly login via your company SSO.</p>
When reaching the login page, you get asked to select your company tenant. Please use therefore the following tenant: <br /> <br /> {idpAlias} <br /> <br /> * which will automatically forward you to the SSO page.
</p>
<p
style="Margin:0;-webkit-text-size-adjust:none;-ms-text-size-adjust:none;mso-line-height-rule:exactly;font-family:arial, 'helvetica neue', helvetica, sans-serif;line-height:21px;color:#333333;font-size:14px">
Your Organization uses Single Sign-On (SSO) to login to the Catena-X core services and business applications.
</p>
<p
style="Margin:0;-webkit-text-size-adjust:none;-ms-text-size-adjust:none;mso-line-height-rule:exactly;font-family:arial, 'helvetica neue', helvetica, sans-serif;line-height:21px;color:#333333;font-size:14px">
By clicking on "Join Now" you can directly login by using your company login data.
</p>
</td>
</tr>
<td
Expand Down
6 changes: 3 additions & 3 deletions src/mailing/Mailing.Template/Enums/EmailTemplateType.cs
Original file line number Diff line number Diff line change
Expand Up @@ -114,10 +114,10 @@ public enum EmailTemplateType
ServiceRequestDecline,

/// <summary>
/// Email template for new users being created on own idp
/// Email template for new users being created on external idp
/// </summary>
[Path("new_user_account_ownidp.html")]
NewUserAccountOwnIdp,
[Path("new_user_account_external_idp.html")]
NewUserAccountExternalIdp,

/// <summary>
/// Email template for credential approvals
Expand Down
7 changes: 7 additions & 0 deletions src/processes/Processes.Worker/appsettings.json
Original file line number Diff line number Diff line change
Expand Up @@ -469,6 +469,13 @@
"EmailTemplateType": "Password"
}
},
{
"Name": "NewUserExternalIdpTemplate",
"Setting": {
"Subject": "",
"EmailTemplateType": "NewUserAccountExternalIdp"
}
},
{
"Name": "EmailRegistrationDeclineTemplate",
"Setting": {
Expand Down

0 comments on commit aabb414

Please sign in to comment.