Skip to content

Design email template sections (2/2) #11551

@benbowler

Description

@benbowler

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:
    • What’s grabbing their attention?
    • What is driving growth and bringing more visitors?
  • 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 minimal wp_kses when required.
  • By the conclusion of this ticket, all template assets should be uploaded to cloud hosting with versioned URLs (manual upload required via team leads).
  • 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

  • Implement the Figma mocks for sections: What’s grabbing their attention? and What is driving growth and bringing more visitors? 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 and Design email template sections (1/2) #11550):
    • includes/Core/Util/Email_Reporting/templates/email-report/parts/section-part-page-metrics.php
    • includes/Core/Util/Email_Reporting/templates/email-report/parts/section-header.php
    • includes/Core/Util/Email_Reporting/templates/email-report/parts/change-badge.php
    • includes/Core/Util/Email_Reporting/templates/email-report/parts/dashboard-link.php
  • With support from team leads, upload the final version of all assets with assets/images/email-development/email-report/ to a Google Cloud bucket with a CDN setup.
    • Update all asset links in the email template to load assets via the CDN.
      • Assets should be stored in a versioned sub folder (using the latest plugin version) - in future all new or updated assets must be uploaded to a new versioned sub folder to make sure old emails don't break in users' inboxes.
    • Keep the assets/images/email-development/email-report/ within the project for local development of future template updates.

Test Coverage

  • No new test coverage required.

QA Brief

Changelog entry

  • N/A

Metadata

Metadata

Assignees

No one assigned

    Labels

    P0High priorityTeam SIssues for Squad 1Type: EnhancementImprovement of an existing feature

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions