Skip to content

feat: improve verification email content — add context, agent name, and HTML template #890

Closed

Description

@vybe

Summary

The 6-digit verification code email is a blank, context-free plain-text message. Users who receive it have no idea what platform it's from, which agent they're trying to access, or why they got it. Both callsites pass only the numeric code — no agent name, no link title, no branding.

Current State

Subject: Your verification code

Body:

Your verification code is: 123456

This code expires in 10 minutes.

If you didn't request this code, you can safely ignore this email.

send_verification_code(to_email, code) has no parameters for context. Both callers pass only the code:

  • src/backend/routers/auth.py:426 — regular email login
  • src/backend/routers/public.py:341 — public link chat verification

There is no HTML template. The service supports HTML (html_body param exists in send_email()) but _get_verification_email_body() only returns plain text and is never called with agent context.

Acceptance Criteria

  • Subject line includes the platform name and agent name when available — e.g. Your Trinity access code for "Research Assistant" or Your Trinity login code
  • Email body names the agent and describes why the code was sent — e.g. "You requested access to Research Assistant on Trinity. Use the code below to verify your identity."
  • send_verification_code() signature accepts optional agent_name and context_label params so callers can pass what they know
  • An HTML version of the email is provided alongside the plain-text fallback — code displayed prominently (large font / styled block), not buried in a sentence
  • Plain-text version remains valid and readable without HTML rendering
  • The "didn't request this" copy is preserved

Technical Notes

Files to change:

  • src/backend/services/email_service.py — extend send_verification_code() signature, add HTML template to _get_verification_email_body()
  • src/backend/routers/auth.py:426 — pass context_label="Trinity login"
  • src/backend/routers/public.py:341 — pass agent_name=link["agent_name"] (already in scope)

The send_email() method already accepts html_body; the fix is purely additive — no transport changes needed.

Activity

  1. added
    priority-p2
    type-feature
    on May 18, 2026
  2. vybe commented on May 18, 2026

    @vybe
    ContributorAuthor

    /claim

  3. github-actions commented on May 18, 2026

    @github-actions

    Claimed by @vybe. Label status-in-progress added.

    Next steps:

    1. Create branch: feature/890-<short-slug>
    2. Implement the feature
    3. Open a PR with Fixes #890
  4. added
    status-in-progress
    on May 18, 2026
  5. added
    status-in-dev
    and removed
    status-in-progress
    on May 18, 2026
  6. vybe commented on Jun 1, 2026

    @vybe
    ContributorAuthor

    Shipped in v0.6.0 (released via #998).

  7. added
    theme-channels
    and removed
    status-in-dev
    on Jun 1, 2026
  8. added a commit that references this issue on Jun 23, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

priority-p2theme-channelstype-feature

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions