Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is it possible to change the email content in keycloak?

Tags:

keycloak

I am new to Keycloak, my project is having keycloak as authentication server. Currently I am developing User maintenance in my project so When new user gets created in keycloak using WEB-API, I wan to send an email to the newly created user, saying welcome to the application and please update your password.

End point: /admin/realms/{realm}/users/{id}/execute-actions-email

I am using the above endpoint to send an update password email and I am passing UPDATE_PASSWORD action to this endpoint.

And it is sending email correctly but I want to add Welcome to Application text in email template and want remove some default text from that template.

Is there any way to change keycloak template content?

like image 427
Dreamer Avatar asked Mar 26 '19 04:03

Dreamer


People also ask

How do you customize a Keycloak?

Step 4: Set customized theme in KeycloakLogin to Keycloak admin and select realm, then go to the theme and select the custom option for the login theme. Remember that the custom option in login will be visible only after adding the custom folder on the path, as explained earlier. This is it!


2 Answers

Yes this this possible you have to make the changes in the couple of files in the location /opt/keycloak/theme and list of files name are

  1. executeActions.ftl(/opt/keycloak/themes/base/email/html)
  2. executeActions.ftl(/opt/keycloak/themes/base/email/text)
  3. messages_en.properties(/opt/keycloak/themes/base/email/messages)

Remember you have to change these files if you are using keycloak default theme ,if you added some other theme please change accordingly .

like image 162
Subodh Joshi Avatar answered Nov 13 '22 21:11

Subodh Joshi


If you want your changes to persist to Keycloak upgrades I suggest you creating a new theme that extends the theme you are using (keycloak is the default theme).

You have detailed instructions in Keycloak's Server Development Guide.

Do not forget selecting the new theme in realm's settings.

like image 30
Eneko Avatar answered Nov 13 '22 23:11

Eneko