SkinnyPigeon opened a new pull request, #27851: URL: https://github.com/apache/superset/pull/27851
<!--- Please write the PR title following the conventions at https://www.conventionalcommits.org/en/v1.0.0/ Example: fix(dashboard): load charts correctly --> ### SUMMARY We use the `EMAIL_HEADER_MUTATOR` to detect errors in reports sent to our external clients. Currently, when an error is detected we send an alert to an internal Slack channel and replace the contents of the notification with a generic message saying `There has been an issue generating your report...`. However, our account managers have asked us not to send the report. Unfortunately, there is no way to prevent the reports from being sent beyond causing an `Exception` to be raised, which causes issues. This PR allows users to use `msg.replace_header("To", <superset_admin/empty_string>)` as part of the `EMAIL_HEADER_MUTATOR` in the config to replace the list of recipients. We plan to either replace the recipients with an empty string or send it to an internal email so we are notified of the results. I [opened an Idea ](https://github.com/apache/superset/discussions/26886)previously for this but it has not been picked up. ### TESTING INSTRUCTIONS I have added an additional unit test in the relevant section of the tests repo. Additionally, in your local setup you can add the following to your `superset_config.py` ```python def EMAIL_HEADER_MUTATOR(msg, **kwargs): msg.replace_header("To", "f...@email.com") return msg ``` ### ADDITIONAL INFORMATION <!--- Check any relevant boxes with "x" --> <!--- HINT: Include "Fixes #nnn" if you are fixing an existing issue --> - [x] Has associated issue: - [ ] Required feature flags: - [ ] Changes UI - [ ] Includes DB Migration (follow approval process in [SIP-59](https://github.com/apache/superset/issues/13351)) - [ ] Migration is atomic, supports rollback & is backwards-compatible - [ ] Confirm DB migration upgrade and downgrade tested - [ ] Runtime estimates and downtime expectations provided - [ ] Introduces new feature or API - [ ] Removes existing feature or API -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: notifications-unsubscr...@superset.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: notifications-unsubscr...@superset.apache.org For additional commands, e-mail: notifications-h...@superset.apache.org