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

Ability to customize emails #9

Closed
Powersource opened this issue May 30, 2021 · 11 comments
Closed

Ability to customize emails #9

Powersource opened this issue May 30, 2021 · 11 comments

Comments

@Powersource
Copy link

Of what I understand this isn't supported yet? Would it be enough to follow this or would other steps/methods be required?

@garronej
Copy link
Collaborator

I am not sure I understand what you mean by customising emails?
Do you mean whitelisting emails domain that are allowed to register? If it's that, it is supported.
If not what page are you referring to?
image

@Powersource
Copy link
Author

I mean the emails that keycloak sends to users when they e.g. sign up and need to verify their email.

@garronej
Copy link
Collaborator

Ahh yeah of course, I see.

Yes this is probably something that we would like to support in the future but that is out of scope for now.

@garronej
Copy link
Collaborator

garronej commented May 30, 2021

Note, however, that we will never be able to implement the emails in React, we can't bundle JS into emails.
If I provide a solution il will probably be based on eta...

@Powersource
Copy link
Author

Thought about it a bit more. For our usecase we don't yet need full easy theming of the emails, being able to easily replace the "message" files at the same time as loading the rest of the theme would be enough. In our case it's keycloak/themes/customtheme/email/messages/messages_en.properties. It would be cool if we could put that in some folder of static files and then it would be inserted by keycloakify in the right location in the jar file :)

@garronej
Copy link
Collaborator

Agreed,
I put that in my todo list but i'll encourage you to implement an alternative solution in the meantime as I don't know when I will have the time to implement it.

@ialisyed
Copy link

Hi @Powersource,

How did you customize emails? Could you please share some insight?

TIA,
Syed

@Powersource
Copy link
Author

@ialisyed As a first solution we just went onto the server and I think manually copied the file in there. See https://github.com/Edgeryders-Participio/multi-dreams/blob/b81caca02f190a464e4814e0c96d0bdf8ae45ddc/keycloak-theme/readme.txt#L33-L45

But now we're in the process of removing keycloak completely from our app and moving to passport instead cobudget/cobudget#321 Things like email customization being so hard and hacky, and other similar things that keycloak made more convoluted than they felt like they needed to be made us want to switch.

@garronej
Copy link
Collaborator

I just want to reiterate that email customisation is something that I want to support with Keycloakify eventually.

@abforman
Copy link

I did a hack to shove an email/ directory into the theme JAR by adding some commands in package.json:

"scripts": {
        "build": "react-scripts build",
        "keycloak": "yarn build && yarn emails && build-keycloak-theme && yarn emails2",
        "emails": "mkdir -p build_keycloak/src/main/resources/theme/THEME_NAME/email; cp -R email build_keycloak/src/main/resources/theme/THEME_NAME/",
        "emails2": "jar -uf ./build_keycloak/target/THEME_NAME-keycloak-theme-VERSION.jar -C . META-INF/keycloak-themes.json",
...

Both the email/ directory hierarchy and the keycloak-themes.json are just static files.

The only reason for the keycloak-themes overlay is to add "email" to the array of types so that it will show up as an entry in the drop-down.

@garronej
Copy link
Collaborator

It's done

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

No branches or pull requests

4 participants