feat(otp): make OTP email customizable (logo, login URL, button text)#809
Open
feat(otp): make OTP email customizable (logo, login URL, button text)#809
Conversation
Add admin-configurable branding for the OTP login email so each
deployment can match its own product:
- Logo URL, max width (px), border thickness (px), border color
- Optional Login URL renders a styled "Sign in" button in the email
- Custom button text (defaults to "Sign in to {site name}")
- Border radius on the logo matches the button radius when a
border is shown
- Color values are sanitized before being interpolated into inline
styles to prevent CSS injection in rendered emails
- Live email preview in the plugin settings page reflects every
change immediately
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
0, login button only renders when a URL is set).Changes
packages/core/src/plugins/core-plugins/otp-login-plugin/manifest.json— schema + defaults for the new fields.packages/core/src/plugins/manifest-registry.ts— mirror defaults in the central plugin registry.packages/core/src/plugins/core-plugins/otp-login-plugin/otp-service.ts— extendOTPSettingsinterface.packages/core/src/plugins/core-plugins/otp-login-plugin/email-templates.ts— render configurable logo (width / border / radius) and optional sign-in button; HTML-escape user-provided values; sanitize colors before injecting into inline styles.packages/core/src/plugins/core-plugins/otp-login-plugin/index.ts— pass the new settings through to the renderer with safe defaults.packages/core/src/templates/pages/admin-plugin-settings.template.ts— admin UI inputs (with a color picker for the border color) and live email preview that reflects each change.Behavior details
border-radius: 8pxto match the sign-in button.#ffffff; default thickness is0(border off).Sign in to {site name}when blank.Testing
vitest run src/plugins/core-plugins/otp-login-plugin— 40/40)tsc --noEmit -p packages/core/tsconfig.json)🤖 Generated with Claude Code