Files
karaoke-gen/scripts/preview-emails.py
T
Andrew Beveridge ☄️andClaude f661b6a27b feat(branding): Implement consistent brand theming across all frontends (#231)
## Summary

- Implement unified brand theming with brand pink (#ff7acc) as primary
color across all Nomad Karaoke frontends
- Create comprehensive brand style guide for human and LLM reference
- Add proper light/dark mode support throughout
- Update homepage content for transparency and accuracy
- Create product communication guide for consistent messaging

## Changes

### Homepage Content Updates
- Changed "in minutes" to "in under 30 minutes" for accuracy
- Removed AI terminology per user preference (use "our system" instead)
- Made review step clearly required, not optional polish
- Fixed YouTube claim: videos go to Nomad Karaoke channel, not user's
- Added demo video embed
- Added placeholder sections for screenshots (job dashboard, lyrics
review, etc.)

### Brand Style Guide (`docs/BRAND-STYLE-GUIDE.md`)
- Comprehensive guide covering colors, typography, logo usage, UI
components, email design
- Updated to v1.1: radial background gradients, logo usage (SVG
preferred), light/dark theme requirements
- Fixed success color consistency (#22c55e)

### Product Communication Guide (`docs/PRODUCT-COMMUNICATION-GUIDE.md`)
- Core principles: transparency over hype, avoid AI term, acknowledge
user effort
- Terminology preferences table
- FAQ guidance for consistent answers
- Referenced in CLAUDE.md for future agent sessions

### Main Frontend (`frontend/`)
- Updated CSS variables in `globals.css` for brand colors and light/dark
mode
- Added ThemeProvider to layout for proper theme switching
- Updated landing page, auth dialog, job cards with brand pink (#ff7acc)
- Created Playwright screenshot tests for visual verification

### Lyrics Transcriber Frontend
- Updated MUI theme with brand pink primary color
- Fixed theme-aware colors in: EditModal, EditWordList, WordDivider,
Word, CorrectedWordWithActions, TranscriptionView, ReferenceView,
AIFeedbackModal
- Fixed TapButton onMouseLeave race condition
- Added clarifying tooltip to Undo Auto Corrections button

### Email Templates
- Refactored to use reusable helper methods (`_build_email_html`,
`_get_email_header`, `_get_email_footer`)
- Updated all 7 email templates with brand pink headers, buttons, and
accents
- Fixed success color to match brand guide (#22c55e)
- Updated preview script to use actual email service

### Other
- Bumped versions: backend 0.96.0, frontend 0.81.0
- Added archive entry for brand consistency work

## Screenshots

### Homepage

| Hero Section | Full Page |
|--------------|-----------|
| ![Homepage
Hero](https://raw.githubusercontent.com/nomadkaraoke/karaoke-gen/feat/sess-20260107-0008-brand-consistency/frontend/public/screenshots/homepage-hero.png)
| ![Homepage
Full](https://raw.githubusercontent.com/nomadkaraoke/karaoke-gen/feat/sess-20260107-0008-brand-consistency/frontend/public/screenshots/homepage-full.png)
|

### Lyrics Review UI

![Lyrics
Review](https://raw.githubusercontent.com/nomadkaraoke/karaoke-gen/feat/sess-20260107-0008-brand-consistency/frontend/public/screenshots/lyrics-review.png)

### Instrumental Review UI

![Instrumental
Review](https://raw.githubusercontent.com/nomadkaraoke/karaoke-gen/feat/sess-20260107-0008-brand-consistency/frontend/public/screenshots/instrumental-review.png)

### Email Templates

| Job Completion | Action Reminder | Beta Welcome |
|----------------|-----------------|--------------|
| ![Job
Completion](https://raw.githubusercontent.com/nomadkaraoke/karaoke-gen/feat/sess-20260107-0008-brand-consistency/frontend/public/screenshots/email-job_completion.png)
| ![Action
Reminder](https://raw.githubusercontent.com/nomadkaraoke/karaoke-gen/feat/sess-20260107-0008-brand-consistency/frontend/public/screenshots/email-action_reminder.png)
| ![Beta
Welcome](https://raw.githubusercontent.com/nomadkaraoke/karaoke-gen/feat/sess-20260107-0008-brand-consistency/frontend/public/screenshots/email-beta_welcome.png)
|

## Test plan

- [x] Playwright screenshots captured
- [x] Visual verification of brand consistency
- [x] Frontend build passes
- [x] CodeRabbit review feedback addressed (3 cycles)

@coderabbitai ignore

🤖 Generated with [Claude Code](https://claude.com/claude-code)

---------

Co-authored-by: Claude <noreply@anthropic.com>
2026-01-07 23:10:35 -05:00

114 lines
3.8 KiB
Python
Executable File

#!/usr/bin/env python3
"""
Preview email templates by generating HTML files.
Usage:
python scripts/preview-emails.py
This will create HTML files in /tmp/email-previews/ that can be opened in a browser.
"""
import os
import sys
from pathlib import Path
# Add parent directory to path for imports
sys.path.insert(0, str(Path(__file__).parent.parent))
# Set dummy env vars before importing
os.environ.setdefault("FRONTEND_URL", "https://gen.nomadkaraoke.com")
from backend.services.email_service import EmailService, PreviewEmailProvider
from backend.services.template_service import TemplateService
def main():
output_dir = Path("/tmp/email-previews")
output_dir.mkdir(exist_ok=True)
# Create email service with preview provider to capture HTML
preview_provider = PreviewEmailProvider()
email_service = EmailService()
email_service.provider = preview_provider
# Create template service for realistic message content
template_service = TemplateService()
print(f"Generating email previews in {output_dir}...")
# Magic link email
email_service.send_magic_link("user@example.com", "abc123xyz")
save_preview(output_dir, "magic_link", preview_provider)
# Credits added email
email_service.send_credits_added("user@example.com", credits=5, total_credits=8)
save_preview(output_dir, "credits_added", preview_provider)
# Welcome email
email_service.send_welcome_email("user@example.com", credits=3)
save_preview(output_dir, "welcome", preview_provider)
# Beta welcome email
email_service.send_beta_welcome_email("user@example.com", credits=1)
save_preview(output_dir, "beta_welcome", preview_provider)
# Feedback request email
email_service.send_feedback_request_email(
"user@example.com",
feedback_url="https://forms.example.com/feedback",
job_title="Taylor Swift - Love Story",
)
save_preview(output_dir, "feedback_request", preview_provider)
# Job completion email - use template service for realistic content
job_completion_content = template_service.render_job_completion(
name="there",
youtube_url="https://www.youtube.com/watch?v=abc123",
dropbox_url="https://www.dropbox.com/folder/example",
artist="Taylor Swift",
title="Love Story",
job_id="abc123",
feedback_url="https://forms.example.com/feedback",
)
email_service.send_job_completion(
to_email="user@example.com",
message_content=job_completion_content,
artist="Taylor Swift",
title="Love Story",
brand_code="NOMAD-1234",
)
save_preview(output_dir, "job_completion", preview_provider)
# Action reminder (lyrics) email - use template service for realistic content
lyrics_reminder_content = template_service.render_action_needed_lyrics(
name="there",
artist="Taylor Swift",
title="Love Story",
review_url="https://gen.nomadkaraoke.com/lyrics/?baseApiUrl=...",
)
email_service.send_action_reminder(
to_email="user@example.com",
message_content=lyrics_reminder_content,
action_type="lyrics",
artist="Taylor Swift",
title="Love Story",
)
save_preview(output_dir, "action_reminder", preview_provider)
print(f"\nOpen these files in a browser to preview the emails.")
print(f"Example: open {output_dir}/magic_link.html")
def save_preview(output_dir: Path, name: str, provider: PreviewEmailProvider):
"""Save the captured HTML to a file."""
html = provider.get_last_html()
if html:
output_file = output_dir / f"{name}.html"
output_file.write_text(html)
print(f" Created: {output_file}")
else:
print(f" ERROR: No HTML captured for {name}")
if __name__ == "__main__":
main()