feat: Customizable email subject name
SUMMARY
This feature allows users to customize the email subject when creating a report or an alert within Superset. This is driven by a need to include specific parameters within the email subject line, enhancing the specificity and resonance of alert or report notifications.
Changes:
- Implementation of a new text input field within the 'create alert/report' interface, through which users can specify their desired email subject line.
- If the text field is left blank, a default email subject line will be generated by the system.
- The user interface will show the new text field solely when the email sending method is selected by a user.
This feature has been tested with Superset master branch. This proposed feature has already been discussed in the Superset Improvement Proposal (see https://github.com/apache/superset/issues/25945)
BEFORE SCREENSHOTS
AFTER SCREENSHOTS
TESTING INSTRUCTIONS
To verify the changes made, please follow these steps: (Assume that there TAG for alert and report and open)
- Go to the Alert and report creation page
- Create one of them
- Fill all the information that required
- Select Notification method as "Email"
- You will see input box for "email subject name"
- Fill the desired subject name and save it
- Wait for email send and check the email subject name
ADDITIONAL INFORMATION
- [ ] Has associated issue:
- [ ] Required feature flags:
- [x] Changes UI
- [x] Includes DB Migration (follow approval process in SIP-59)
- [x] Migration is atomic, supports rollback & is backwards-compatible
- [x] Confirm DB migration upgrade and downgrade tested
- [x] Runtime estimates and downtime expectations provided
- [ ] Introduces new feature or API
- [ ] Removes existing feature or API
Run: superset db downgrade
Run: superset db upgrade
Thanks for contributing @puridach-w . I've added some minor suggestions and kicked off the build for you.
Codecov Report
Attention: Patch coverage is 68.75000% with 10 lines in your changes are missing coverage. Please review.
Project coverage is 69.81%. Comparing base (
b25dd0c) to head (c78a4d1).
Additional details and impacted files
@@ Coverage Diff @@
## master #26327 +/- ##
==========================================
- Coverage 69.81% 69.81% -0.01%
==========================================
Files 1910 1910
Lines 74827 74856 +29
Branches 8346 8357 +11
==========================================
+ Hits 52243 52263 +20
- Misses 20532 20538 +6
- Partials 2052 2055 +3
| Flag | Coverage Δ | |
|---|---|---|
| hive | 48.99% <44.44%> (+<0.01%) |
:arrow_up: |
| javascript | 57.39% <60.86%> (+<0.01%) |
:arrow_up: |
| mysql | 77.98% <88.88%> (-0.03%) |
:arrow_down: |
| postgres | 78.12% <88.88%> (+<0.01%) |
:arrow_up: |
| presto | 53.72% <44.44%> (+<0.01%) |
:arrow_up: |
| python | 83.14% <88.88%> (+<0.01%) |
:arrow_up: |
| sqlite | 77.55% <88.88%> (+<0.01%) |
:arrow_up: |
| unit | 56.72% <44.44%> (+<0.01%) |
:arrow_up: |
Flags with carried forward coverage won't be shown. Click here to find out more.
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.
Codecov Report
Attention:
6 linesin your changes are missing coverage. Please review.Comparison is base (
8c32c6d) 69.18% compared to head (f7c7a9a) 59.04%. Report is 5 commits behind head on master.Files Patch % Lines superset/commands/report/execute.py 0.00% 6 Missing ⚠️ Additional details and impacted files ☔ View full report in Codecov by Sentry. 📢 Have feedback on the report? Share it here.
What should I do with this? Can you suggest please.
ping @eschutho and @lilykuang who are working on SIP-110.
@giftig @john-bodley Could you please help me review this PR again?
@puridach-w the code all looks ok to me but I'm not very familiar with the subject of reports. I think it'd be a good idea to get a review from @eschutho or @lilykuang since they're working on the related SIP John mentioned above; would be good to confirm what's done here aligns ok with that work.
@kasiazjc and @yousoph for design feedback, too.
/testenv up FEATURE_ALERT_REPORTS=true
@eschutho Ephemeral environment spinning up at http://34.222.243.175:8080. Credentials are admin/admin. Please allow several minutes for bootstrapping and startup.
Ping @eschutho I have already modified the code based on your comment.
Ping @eschutho Could you please help me review this PR again?
Ping @eschutho Could you please help me review this PR again?
A rebase of this branch and running the pre-commit hook should fix the CI issues you're seeing. 🤞
Hi @puridach-w ! Thanks for this new feature, it's looking good
About the subject line UI, I think we can make it a required field in the form, but filled out with the default report name when the form is opened and it can update as the user changes the inputs. If the user clears it they will see that the field is required. There should be patterns on the modal that you can look to for behavior of required fields (red asterisk for example), but let me know if there's anything you'd like help defining!
Thanks!
Hello @puridach-w, feel free to ping me when you are ready for another round of review. Thanks!
/testenv up FEATURE_ALERT_REPORTS=true
@geido Ephemeral environment spinning up at http://18.246.236.152:8080. Credentials are admin/admin. Please allow several minutes for bootstrapping and startup.
http://18.246.236.152:8080
/testenv up FEATURE_ALERT_REPORTS=true
FYI, I still haven't edited the code from yousoph comment. But I appreciate your care and attention. Thank you very much.
Np @puridach-w. There are a few conflicts as I just merged a PR that changes the styles of the A&R modal. I hope that does not become too much of a hassle. Let me know!
@puridach-w just messaged you on Apache Superset Slack to help with the CI issues
Ping @eschutho @geido I request another review of my PR? Thank you!
/testenv up FEATURE_ALERT_REPORTS=true
@geido Ephemeral environment spinning up at http://35.93.23.71:8080. Credentials are admin/admin. Please allow several minutes for bootstrapping and startup.
Hey @puridach-w doing some manual testing. It seems that the spacing is off here
Hey @puridach-w doing some manual testing. It seems that the spacing is off here
Hi @geido, the modifications have been completed. Could you please review them once more?
/testenv up FEATURE_ALERT_REPORTS=true
@geido Ephemeral environment spinning up at http://35.91.216.144:8080. Credentials are admin/admin. Please allow several minutes for bootstrapping and startup.
Hey @puridach-w if you look at the testenv above, you will see that there is a : in the placeholder. I think something might be broken in the placeholder logics.
Hey @puridach-w if you look at the testenv above, you will see that there is a
:in the placeholder. I think something might be broken in the placeholder logics.
Hi @geido , I've updated the placeholder logic. Please help me to review this PR again.

