How do I localize the language of the password reset email?
1077 Views 4 Helpful


How do I localize the language of the password reset email?


  • Registration-as-a-Service (RaaS)


Gigya allows configuring Email Templates[1] for different languages in the Gigya Admin Console. For most emails, such as "New User Welcome", or "Email Verification", the language of the email that will be selected is determined based on the profile.locale field stored for the particular user. However, if this field is not set, it is possible to control this by passing the "lang" parameter to the accounts.resetPassword[2][3] API method.


The accounts.resetPassword[2][3] API call supports a "lang" parameter that can be used to control which Language template is used to send the email. When using the screen-sets[4], this parameter can be controlled by doing the following:

  1. Add a hidden field to the markup of the "Forgot Password" Screen:

    <input id="passwordResetEmailLang" type="hidden" name="lang" class="gigya-input-text">
  2. Create, or add to, the onAfterScreenLoad Screen-Set Event[5] handler function:

    function onAfterScreenLoadHandler(responseObj) {
      if(responseObj.currentScreen === 'gigya-forgot-password-screen'){
        var passwordResetLang = 'EN'; //control this variable to change the language of the Password Reset Email
        document.getElementById('passwordResetEmailLang').value = passwordResetLang;
  3. Ensure that the event handler function is linked to the onAfterScreenLoad Screen-Set Event:

    var params ={
      screenSet: 'Default-RegistrationLogin',
      onAfterScreenLoad: onAfterScreenLoadHandler

Note: The "lang" parameter is only valid if the user's "profile.locale" field is not set. Otherwise, it will be ignored.



Was this article helpful?