-
Notifications
You must be signed in to change notification settings - Fork 336
Closed
Closed
Copy link
Labels
P0High priorityHigh priorityTeam SIssues for Squad 1Issues for Squad 1Type: EnhancementImprovement of an existing featureImprovement of an existing feature
Description
Feature Description
Update the email reporting infrastructure to support in email report notices. The initial notices will be:
- Analytics set up (views at the top of the template)
- Enable Conversion events (views within a section) this ticket
Email notices should be flexible for future registered notifications.
Notices should be dismissed if clicked or after being included in two email reports.
Do not alter or remove anything below. The following sections will be managed by moderators only.
Acceptance criteria
- Email reports support section-level notices registered via the notice infrastructure implemented in Add support for in email notices - Analytics set up (views at the top of the template) #11843; notices can target specific sections and render inline within that section.
- The "Enable conversion events" notice (Figma design) renders inside the conversions section when plugin conversion tracking events are not enabled for the recipient's site/user context (and Analytics module is shared with/user has access to).
- The notice CTA routes through the email link proxy, dismisses the notice for the user, and redirects to the dashboard location to enable conversion events (Analytics module edit settings screen where conversion toggle is located).
- Notices are suppressed once dismissed and are automatically dismissed after they have appeared in two sent reports for that user.
- If conversion events are already enabled or the user cannot act, the notice does not render and the rest of the section remains unchanged.
- *Show notice when conversion tracking is disabled and any of the supported plugins is detected
Implementation Brief
- Add section placement support to the email notice registry/resolver (
includes/Core/Email_Reporting/Email_Notices.php):- Extend the notice schema to accept
placement(header/section) plussection_key, update the resolver to filter by placement, and addget_section_notices( WP_User $user, string $section_key )that returns only notices whoseshould_displaypasses and whosesection_keymatches the requested section. - Use the dismissal/impression tracking from Add support for in email notices - Analytics set up (views at the top of the template) #11843’s
Email_Noticesimplementation (Dismissed_Prompts+ count/expiry); this issue should only consume that API for the section notice and must not add new storage or duplicate logic. - Register the conversions notice in the
Email_Noticesdefinitions list: add a new notice config entry (alongside the existing header notices from Add support for in email notices - Analytics set up (views at the top of the template) #11843) withplacement: sectionandsection_key: is_my_site_helping_my_business_grow. Theshould_display( WP_User $user )callback should:- Confirm Analytics is available to the user (admin or shared access) and
- Conversions are not enabled;
- The
get_payload()callback returns the localized title/body/CTA label plus the CTA URL built via the email link proxy (include the notice ID so the proxy can dismiss on click). - Build the CTA URL through the email link proxy introduced in Implement Golinks concept for generalisable redirects to SK screens #11849, include
notice_idfor click-based dismissal, and target the Analytics settings view where the conversions toggle lives.
- Extend the notice schema to accept
- in
Email_Template_Formatter::build_template_payload()- Resolve section notices via the new
Email_Notices::get_section_notices( $user, $section_key )and include the results under a newtemplate_data['section_notices']map keyed by section key. - Then in
section-conversions.php, readsection_notices['is_my_site_helping_my_business_grow'](if present) and render the notice at the top of the section body. If no notice exists for that key, the template stays unchanged. (Use a shared partial if one already exists for header notices, or add a smallnotice.phppartial to keep markup consistent.)
- Resolve section notices via the new
Test Coverage
- Add tests for notice eligibility (conversions off + user has Analytics access), suppression when dismissed or
count >= 2, and CTA proxy URL includesnotice_id. - Template rendering: conversions section includes the notice when eligible and remains unchanged otherwise.
QA Brief
- Setup Site Kit with
proactiveUserEngagementFF enabled - Subscribe to email reporting
- Setup Analytics module and disable conversion tracking
- Trigger email report:
- Verify email notice is not showing
- Install one of the supported plugins for conversion tracking (eq Contact Form 7, or Easy Digital Downloads, or WooCommerce, or WPForms)
- Trigger email report:
- Verify that notice is showing
- Notice should be showing 2 times, and then on third email it should not appear, or if setup CTA is taken after first showing, it should not appear again
- Note: after notice is seen it will have 24h expiration, when sending consecutive emails to confirm it shows only in 2 emails, update expiration for the notice, you can use the timestamp provided in Add support for in email notices - Analytics set up (views at the top of the template) #11843
Changelog entry
- Add support for conversion events in email reports.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
P0High priorityHigh priorityTeam SIssues for Squad 1Issues for Squad 1Type: EnhancementImprovement of an existing featureImprovement of an existing feature