Skip to content

Remove email templates migrated to ol-keycloakify#251

Open
blarghmatey wants to merge 2 commits intomainfrom
remove-email-templates
Open

Remove email templates migrated to ol-keycloakify#251
blarghmatey wants to merge 2 commits intomainfrom
remove-email-templates

Conversation

@blarghmatey
Copy link
Copy Markdown
Member

Summary

Removes the legacy HTML email templates now that they have been migrated to ol-keycloakify#115 as React components using keycloakify-emails + jsx-email.

⚠️ Do not merge until mitodl/ol-keycloakify#115 has been merged and deployed.

Templates removed

  • email/html/template.ftl — email layout (header/footer)
  • email/html/email-verification.ftl — verify email template
  • email/html/password-reset.ftl — password reset template

Related

The HTML email templates have been migrated to ol-keycloakify where
they are now implemented as React components using keycloakify-emails
and jsx-email, with full MIT/OL branding.

See mitodl/ol-keycloakify#115

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@blarghmatey blarghmatey added the do not merge This PR should not be merged yet label Feb 27, 2026
@gemini-code-assist
Copy link
Copy Markdown

Summary of Changes

Hello, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request cleans up the codebase by removing outdated HTML email templates. This action is a direct result of a strategic migration to centralize and modernize email template management within the ol-keycloakify project, utilizing React components for enhanced flexibility and maintainability. The change ensures that email rendering is handled by the new system, eliminating redundancy and simplifying future updates.

Highlights

  • Legacy Email Template Removal: Removed three legacy HTML email templates: email-verification.ftl, password-reset.ftl, and template.ftl.
  • Migration to ol-keycloakify: These templates have been migrated to the ol-keycloakify project, where they are now implemented as React components using keycloakify-emails and jsx-email.
  • Deployment Dependency: This pull request should not be merged until the corresponding ol-keycloakify PR (Migrate email templates to MIT/OL theming ol-keycloakify#115) has been merged and deployed.
Changelog
  • ol-keycloak/oltheme/src/main/resources/theme/ol/email/html/email-verification.ftl
    • Removed the FreeMarker template for email verification.
  • ol-keycloak/oltheme/src/main/resources/theme/ol/email/html/password-reset.ftl
    • Removed the FreeMarker template for password reset.
  • ol-keycloak/oltheme/src/main/resources/theme/ol/email/html/template.ftl
    • Removed the base FreeMarker email layout template.
Activity
  • The author, blarghmatey, created this pull request to remove legacy email templates after their migration.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link
Copy Markdown

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request aims to remove legacy email templates that have been migrated. While it correctly removes the generated .ftl files, it overlooks the removal of the source .mjml files. This oversight means the deleted files will be regenerated on the next build, nullifying the change. I've added a specific comment with details on the source files that also need to be removed to complete this migration.

@@ -1,263 +0,0 @@
<!doctype html>
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

high

While this file and other templates are being removed, their source .mjml files are not. The build script (scripts/compile-emails.sh) will regenerate these deleted .ftl files from the existing sources, making this PR ineffective. To fix this, please also remove the corresponding source files:

  • ol-keycloak/oltheme/src/main/resources/theme/ol/email/mjml/email-verification.mjml
  • ol-keycloak/oltheme/src/main/resources/theme/ol/email/mjml/password-reset.mjml
  • ol-keycloak/oltheme/src/main/resources/theme/ol/email/mjml/template.mjml

Email templates are now maintained in ol-keycloakify as React components.
There is no longer any email compilation or testing to perform here.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
blarghmatey added a commit to mitodl/ol-keycloakify that referenced this pull request Mar 6, 2026
## Summary

Migrates Keycloakify email templates to use full MIT/OL branding,
replacing the MJML-based FTL templates previously maintained in
`ol-keycloak`. Templates are now React components using
`keycloakify-emails` and `jsx-email`, matching the visual identity of
the login pages.

Closes mitodl/hq#8794
See cleanup PR: mitodl/ol-keycloak#251

## Changes

### `src/emails/styles.ts` *(new)*
Shared inline style objects (`paragraph`, `ctaButton`, `fallbackUrl`)
extracted into a single module to avoid drift across templates.

### `src/emails/layout.tsx`
Rewrote `EmailLayout` with full MIT branding:
- `#F3F4F8` background, white card with `border-radius:8px`,
`max-width:600px`
- Header: MIT Learn logo (left) + MIT logo (right), separated by a
`#DDE1E6` border-bottom
- Adobe Typekit font (`neue-haas-grotesk-text`) via `<link>` in `<Head>`
(non-Outlook clients)
- Footer: realm name + 77 Massachusetts Ave, Cambridge address
- Uses jsx-email table components (`Row`, `Column`, `Img`) for Outlook
compatibility
- PNG logos referenced via `import.meta.isJsxEmailPreview` URL pattern
for correct asset resolution in both preview and production

### `src/emails/templates/assets/mit-learn-logo.png` *(new)*
PNG MIT Learn logo (300×55px) for email header. PNG used instead of SVG
for broad email client support (Gmail, Outlook).

### `src/emails/templates/assets/mit-logo-black.png` *(new)*
PNG MIT logo (45×24px) for email header.

### `src/emails/templates/email-verification.tsx`
Rewrote to use `EmailLayout` with MIT-branded content:
- "Verify Your Email" heading
- `exp("realmName")` in body text
- MIT red (`#A31F34`) CTA button linking to `exp("link")`
- Expiration notice and fallback URL

### `src/emails/templates/password-reset.tsx` *(new)*
Created missing password-reset template matching
`ol-keycloak/password-reset.ftl`:
- "Reset Your Password" heading
- MIT red CTA button
- Fallback URL

### `src/emails/templates/org-invite.tsx`
Simplified by removing brittle theme `if/else` branching. Now uses
`exp("realmName")` generically, so it works consistently for both
`ol-learn` and `ol-data-platform` themes.

## Design tokens used
| Token | Value |
|---|---|
| Background | `#F3F4F8` |
| Card bg | `#FFFFFF`, `border-radius:8px` |
| Header/footer border | `#DDE1E6` |
| Text | `#212326` |
| CTA button | `#A31F34` (MIT red) |
| Font | `neue-haas-grotesk-text, sans-serif` |

---------

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

do not merge This PR should not be merged yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant