Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Email Template localization is not honoured in iS 7.0 #22107

Open
UpekshaGalappaththi opened this issue Dec 23, 2024 · 0 comments
Open

Email Template localization is not honoured in iS 7.0 #22107

UpekshaGalappaththi opened this issue Dec 23, 2024 · 0 comments
Labels

Comments

@UpekshaGalappaththi
Copy link

UpekshaGalappaththi commented Dec 23, 2024

Description

In IS 7.0 the claim 'Local' (http://wso2.org/claims/local) is used to identified the user's preferred locale to send email in the specified locale. However this is not working as expected in IS 7.0
Regardless of which locale the user has in the claims, the email will be sent only in the default english (en_US) language.

Steps to Reproduce

  • Add the Local claim value of a user to another local (fr_FR )
  • Customize any Email template type with a france locale (Admin Initiated Password Reset)
  • Trigger the user an admin forced password reset through the console
  • The received email will be in the en_US locale not in fr_FR locale

Analysis

  • In the identity.event.handler.notification.util.NotificationUtil class userClaims.get(NotificationConstants.EmailNotification.CLAIM_URI_LOCALE) method correctly fetches the locale[1] as fr-FR
  • However in the NotificationHandlerDataHolder.getInstance().getEmailTemplateManager()
    .getEmailTemplate(notificationEvent, locale, applicationDomain); method even though the correct locale is passed which is fr-FR, the 'emailTemplate ' value is returned always with the en-US locale[2]
    This causes the notification email to be sent in English rather than in french

Version

IS 7.0

[1] https://github.com/wso2-extensions/identity-event-handler-notification/blob/v1.8.6/components/event-handler-notification/org.wso2.carbon.identity.event.handler.notification/src/main/java/org/wso2/carbon/identity/event/handler/notification/util/NotificationUtil.java#L640
[2] https://github.com/wso2-extensions/identity-event-handler-notification/blob/v1.8.6/components/event-handler-notification/org.wso2.carbon.identity.event.handler.notification/src/main/java/org/wso2/carbon/identity/event/handler/notification/util/NotificationUtil.java#L655

Environment Details (with versions)

No response

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant