Skip to content

Add 'Email me' action to send quiz results via mailto - #1

Draft
Rtavare wants to merge 1 commit into
mainfrom
codex/add-email-function-for-results
Draft

Add 'Email me' action to send quiz results via mailto#1
Rtavare wants to merge 1 commit into
mainfrom
codex/add-email-function-for-results

Conversation

@Rtavare

@Rtavare Rtavare commented May 20, 2026

Copy link
Copy Markdown
Owner

Motivation

  • Allow participants to send themselves their quiz result via their device's mail client so they can keep or share the outcome outside the browser.

Description

  • Added an Email me button to the result action row in the results view and wired it into the UI markup (index.html).
  • Added i18n strings for the email button and subject in both English and Spanish (btn_email, email_subject) and an email validation alert string (alert_email_invalid), and updated applyStaticTranslations() to set the button label.
  • Implemented emailResult() which builds a mailto: URL using the existing makeShareText() output plus the app URL and opens it (window.location.href = mailto;).
  • Wired the new handler with el("emailBtn").addEventListener("click", emailResult); and ensured labels update with language toggles.

Testing

  • Launched the app locally with python3 -m http.server 4173 and confirmed the server started successfully.
  • Ran an automated Playwright script (mcp__browser_tools__run_playwright_script) that completed a quiz to the result screen and captured a screenshot showing the new Email me button, which succeeded.
  • Verified the mailto: URL is constructed from makeShareText() and the app URL by inspecting the flow during the automated run, and observed no runtime errors.

Codex Task

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant