-
Notifications
You must be signed in to change notification settings - Fork 328
Closed
Labels
P0High priorityHigh priorityTeam SIssues for Squad 1Issues for Squad 1Type: EnhancementImprovement of an existing featureImprovement of an existing feature
Description
Feature Description
- Implement a set of the email template module sections
- Test the sections on mobile, web and desktop email clients
Do not alter or remove anything below. The following sections will be managed by moderators only.
Acceptance criteria
- Renders additional modular sections (Figma designs) for the email-report template key using mock data only; no live data or scheduler logic in this issue:
- How many people are finding and visiting my site?
- How are people finding me?
- Rendered via the reusable Email class as implemented in Create a reusable Email class #11564.
- Utilises the keyed folder structure, extending the base template in Create email report base template #11549, within the parts folder.
- Sections are conditionally included if the data for that section is provided. No module access logic should be included in the template.
- If a section’s data array is absent/empty (e.g., module not shared/available in user context), the section is omitted without leaving visual gaps or broken spacers.
- Sections which share designs should share template parts.
- Formatting helpers should be created to ensure:
- Numeric formatting: thousands/millions abbreviations with up to 2 decimal places where relevant; negative deltas include a minus sign.
- Titles/labels truncated to preserve layout (overflow ellipsis may not be supported, so direct cutoff may be needed); long domains are non-overflowing.
- All output escaped at echo time using appropriate
esc_*functions; allow only known-safe HTML via minimalwp_kseswhen required.
- For development, assets can be loaded locally; they will later move to cloud hosting with versioned URLs.
- All strings translatable (text domain:
google-site-kit) with translators' comments where context is helpful. - Basic dark-mode friendly colours ensuring contrast in common clients that auto-invert (can be tested using Email on Acid).
Implementation Brief
- Create
includes/Core/Util/Email_Reporting/templates/email-report/parts/section-part-metrics.phpandincludes/Core/Util/Email_Reporting/templates/email-report/parts/section-part-page-metrics.php: Implement the Figma mocks for sections: How many people are finding and visiting my site? and How are people finding me? block with titles, metrics with inline styles. Section icon image via plugin_url with explicit alt/width/height. Dashboard CTA link linking to relevant dashboard link. Dashboard link and change badge used for % change, using existing reusable parts (added in Create email report base template #11549):includes/Core/Util/Email_Reporting/templates/email-report/parts/section-header.phpincludes/Core/Util/Email_Reporting/templates/email-report/parts/change-badge.phpincludes/Core/Util/Email_Reporting/templates/email-report/parts/dashboard-link.php
Test Coverage
- No new test coverage required.
QA Brief
- Get the pre-release version of the tester plugin from @benbowler.
- From the new Email Reporting tab, open the email template preview by clicking the "Launch Report Preview" button:
-
- Review the template in the browser, comparing it to the Figma designs. It should not be pixel-perfect, but obvious differences should be raised and discussed. Notes:
- Right click and click "View page source" - copy the HTML into Email on Acid and review each client. Again, this should not be pixel-perfect, but obviously broken emails should be flagged.
- Dark mode changes should be added to Update email-report template to support dark mode #11833 to be addressed later.
Changelog entry
- Add email reporting templates.
Metadata
Metadata
Assignees
Labels
P0High priorityHigh priorityTeam SIssues for Squad 1Issues for Squad 1Type: EnhancementImprovement of an existing featureImprovement of an existing feature