p2-inc / keycloak-magic-link

Magic Link Authentication for Keycloak
https://phasetwo.io
Other
222 stars 44 forks source link

Customizing email templates #24

Closed abhilashlr7 closed 1 year ago

abhilashlr7 commented 1 year ago

Despite adding the magic-link-email.ftl with necessary changes, the updated template doesn't seem to be picked. What is the right way to get a custom template for this plugin to work effectively? And where should the template files be places?

xgp commented 1 year ago

Where are you putting that file? How are you placing it in your Keycloak deployment?

abhilashlr7 commented 1 year ago

Ah I think I figured out somehow on getting this resolved. Now I've a related question. How do we configure the form that renders for magic link inside the parent template.ftl? What's the override for this? I tried customising login.ftl but that doesn't seem to be picked.

xgp commented 1 year ago

I don't understand the question. The template that is rendered automatically after a successful magic link request is https://github.com/p2-inc/keycloak-magic-link/blob/main/src/main/resources/theme-resources/templates/view-email.ftl

abhilashlr7 commented 1 year ago

So when magiclink is enabled, we see the screen that asks for email address. Now, i need to add some UI elements to it and beautify it. However, I am unable to find out what's the template (file) that needs to be put up and the path that it needs to be used for customisation.

xgp commented 1 year ago

We use the standard login-username form from the keycloak theme. You can override this by building your own custom theme. Documentation for doing that is here.

abhilashlr7 commented 1 year ago

Cool. thanks for the help @xgp :)