Skip to content

🚧 Add branding to confirmation email#2317

Merged
lukevella merged 1 commit intomainfrom
luke/ral-1132-apply-custom-branding-to-confirmation-email-when-responding
Apr 7, 2026
Merged

🚧 Add branding to confirmation email#2317
lukevella merged 1 commit intomainfrom
luke/ral-1132-apply-custom-branding-to-confirmation-email-when-responding

Conversation

@lukevella
Copy link
Copy Markdown
Owner

@lukevella lukevella commented Apr 7, 2026

Summary by CodeRabbit

  • New Features

    • Added customizable email branding support with colors and logos.
  • Style

    • Enhanced email design with rounded corner styling on buttons, cards, and logos.

@vercel
Copy link
Copy Markdown

vercel bot commented Apr 7, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
app Ready Ready Preview, Comment Apr 7, 2026 2:11pm
1 Skipped Deployment
Project Deployment Actions Updated (UTC)
landing Skipped Skipped Apr 7, 2026 2:11pm

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai bot commented Apr 7, 2026

Walkthrough

The PR refactors getEmailClient to accept an options object with optional locale, primaryColor, and logoUrl parameters instead of a single locale string. All call sites are updated to pass locale via the new object format. The participants email flow additionally fetches space branding data and conditionally applies it during email client initialization. Email component styling is adjusted to use 6px border radius.

Changes

Cohort / File(s) Summary
Email Client API Refactor
apps/web/src/utils/emails.ts
getEmailClient signature changed from accepting a single optional locale string to an options object with locale, primaryColor, and logoUrl properties. Branding fields are conditionally applied to email client config with fallback to default branding values.
Email Client Call Site Updates
apps/web/src/lib/auth.ts, apps/web/src/trpc/routers/polls.ts, apps/web/src/trpc/routers/polls/comments.ts, apps/web/src/trpc/routers/spaces.ts, apps/web/src/trpc/routers/user.ts
Updated all getEmailClient invocations to pass locale within an options object: getEmailClient(locale)getEmailClient({ locale }). Email sending control flow remains unchanged.
Participant Email Branding Enhancement
apps/web/src/trpc/routers/polls/participants.ts
Extended data fetching to include space branding fields (showBranding, primaryColor, image). Confirmation email client initialization now conditionally includes primaryColor and logoUrl computed from space branding when space?.showBranding is enabled.
Email Component Styling
packages/emails/src/components/email-layout.tsx, packages/emails/src/components/styled-components.tsx
Updated border radius from 4px to 6px for logo image (Img) and exported Button and Card components in email templates.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related PRs

Poem

🐰 A bunny hops through email flows,
With branding now that proudly shows—
From locale string to options bright,
Six pixels round the corners right! ✨📧

🚥 Pre-merge checks | ✅ 2 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title mentions adding branding to confirmation email, which aligns with the main change—specifically extending participant/poll data to include space branding fields and applying custom branding to confirmation emails in participants.ts.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch luke/ral-1132-apply-custom-branding-to-confirmation-email-when-responding

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

🧹 Nitpick comments (1)
apps/web/src/lib/auth.ts (1)

110-118: Optional: flatten nested await for readability.

This is correct as-is, but assigning the client first is easier to scan/debug.

♻️ Suggested refactor
-      await (await getEmailClient({ locale })).sendTemplate(
+      const emailClient = await getEmailClient({ locale });
+      await emailClient.sendTemplate(
         "ResetPasswordEmail",
         {
           to: user.email,
           props: {
             resetLink: url,
           },
         },
       );
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@apps/web/src/lib/auth.ts` around lines 110 - 118, The nested await makes the
call harder to read; first await getEmailClient({ locale }) and store it in a
local variable (e.g., emailClient) and then call await
emailClient.sendTemplate("ResetPasswordEmail", { to: user.email, props: {
resetLink: url } }); — update the call site that uses getEmailClient and
sendTemplate to use this two-step sequence for readability and easier debugging.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Nitpick comments:
In `@apps/web/src/lib/auth.ts`:
- Around line 110-118: The nested await makes the call harder to read; first
await getEmailClient({ locale }) and store it in a local variable (e.g.,
emailClient) and then call await emailClient.sendTemplate("ResetPasswordEmail",
{ to: user.email, props: { resetLink: url } }); — update the call site that uses
getEmailClient and sendTemplate to use this two-step sequence for readability
and easier debugging.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: 99d0fe3a-194a-4bd7-932f-ae2efff12887

📥 Commits

Reviewing files that changed from the base of the PR and between d537e95 and d6a059c.

📒 Files selected for processing (9)
  • apps/web/src/lib/auth.ts
  • apps/web/src/trpc/routers/polls.ts
  • apps/web/src/trpc/routers/polls/comments.ts
  • apps/web/src/trpc/routers/polls/participants.ts
  • apps/web/src/trpc/routers/spaces.ts
  • apps/web/src/trpc/routers/user.ts
  • apps/web/src/utils/emails.ts
  • packages/emails/src/components/email-layout.tsx
  • packages/emails/src/components/styled-components.tsx

@lukevella lukevella merged commit 66c3549 into main Apr 7, 2026
13 checks passed
@lukevella lukevella deleted the luke/ral-1132-apply-custom-branding-to-confirmation-email-when-responding branch April 7, 2026 15:13
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

Successfully merging this pull request may close these issues.

1 participant