Skip to content

From address headers not updated on all emails sent by Email Reporting #12390

@benbowler

Description

@benbowler

Feature Description

While debugging another issue, I found that the buildHeaders method is not being used in all of the places where emails are being sent within the plugin. Realistically, this means that the sender name will be inconsistent across all emails sent from the plugin, although this is a low-priority fix, it's worth looking at when we get the chance.


Do not alter or remove anything below. The following sections will be managed by moderators only.

Acceptance Criteria

  • Monthly/weekly report emails and invitation emails use the same header-building method as error notification emails
  • No email send path passes an empty array for headers

Implementation Brief

Backend

  • Update file includes/Core/Email_Reporting/Email_Report_Sender.php

    • Replace array() with $this->email_sender->build_headers() in the send() call at line 88
  • Update file includes/Core/Email_Reporting/REST_Email_Reporting_Controller.php

    • Replace array() with $this->email_sender->build_headers() in the invitation send call at line 405

Test Coverage

  • Update file tests/phpunit/integration/Core/Email_Reporting/Worker_TaskTest.php
    • Update 2 send() parameter assertions from array() to $this->isType( 'array' )

QA Brief

  • From the Site Kit dashboard, click your user avatar, choose "Manage email reports", select "Weekly", then click "Subscribe", and confirm the subscription email's From header reads Site Kit <admin-email> matching Settings → General.
  • In the same panel, scroll to "Invite others to subscribe", click "Send invite" on an eligible non-subscribed user, and confirm the invitation email's From header reads the same Site Kit <admin-email>.

Changelog entry

  • Ensure email headers always include the correct "From" header.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Good First IssueGood first issue for new engineersP2Low priorityPHPTeam SIssues for Squad 1Type: EnhancementImprovement of an existing feature

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions