-
Notifications
You must be signed in to change notification settings - Fork 14.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: add date format to the email subject #31413
feat: add date format to the email subject #31413
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #31413 +/- ##
===========================================
+ Coverage 60.48% 83.46% +22.97%
===========================================
Files 1931 546 -1385
Lines 76236 39292 -36944
Branches 8568 0 -8568
===========================================
- Hits 46114 32795 -13319
+ Misses 28017 6497 -21520
+ Partials 2105 0 -2105
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
0c164a3
to
eb04b3a
Compare
eb04b3a
to
60378db
Compare
@US579 can you also add some documentation on how this is used? It won't be clear for users who don't know about this feature that they can start doing this post merge. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The flag should also be documented/categorized in FEATURE_FLAGS.md
hey @sadpandajoe Could you point me where is the bast place to add this doc, currently i just added here |
@US579 great question. I would say you can either put it in the alerts and reports sections: https://github.com/apache/superset/blob/4ff9aac1fae2d88fd7667317c706256d3cfcb4f4/docs/docs/configuration/alerts-reports.mdx or in the faq https://github.com/apache/superset/blob/4ff9aac1fae2d88fd7667317c706256d3cfcb4f4/docs/docs/faq.mdx |
Totally get the use case. Hey I'm wondering if it may make sense to support more templating in emails (subject and body) in general to tackle this use case but similar ones as well. I know jinja isn't safe for untrusted (user-provided) content, maybe we could use some pybars or something untrusted safe to allow for bringing arbitrary context in arbitrary places in the subject/body. |
…-heading-and-description
…uperset-heading-and-description
/korbit_review |
hey @rusackas thanks for reviewing! any chance we could merge this? |
@US579 looks like a rebase is needed to fix the e2e test that is failing. |
…-heading-and-description
thanks, pipeline has been fixed |
@sadpandajoe any choice we could merge this? please let me know if there is anything pending |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Co-authored-by: Steven Liu <[email protected]>
SUMMARY
Problem
If the subject remains the same, all scheduled reports will be delivered in the same email thread, requiring the recipient to scroll back to the original thread to find the latest email.
However, if a date is included in the email subject, the emails will not be grouped in the same thread. To address this, I propose adding a feature that allows users to specify a date format in the email subject, enabling the email client to correctly thread the emails and display them in a more organized manner.
BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF
Before
![Screenshot 2024-12-12 at 11 57 06 am](https://private-user-images.githubusercontent.com/37062041/394967575-e92d106f-13ed-48a7-86dc-3b4241712391.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MzkxNjI2OTcsIm5iZiI6MTczOTE2MjM5NywicGF0aCI6Ii8zNzA2MjA0MS8zOTQ5Njc1NzUtZTkyZDEwNmYtMTNlZC00OGE3LTg2ZGMtM2I0MjQxNzEyMzkxLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNTAyMTAlMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjUwMjEwVDA0Mzk1N1omWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTgzNzE1YzJjNDdlZmJkYjFmZjQ3ZTM0ODg3NTk5ZjcwZmQ1YzhiODg0ZDk5Yjg4NGY4ZTliNDg1MTgwMmEyOWQmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0In0.1qdYEjpVrVrBsiGPHxb4wD6QHD07RHNn87KGYFeL8nY)
After
![Screenshot 2024-12-12 at 11 57 30 am](https://private-user-images.githubusercontent.com/37062041/394967642-d250bed0-dcc8-403f-8eae-34a7190e3e1e.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MzkxNjI2OTcsIm5iZiI6MTczOTE2MjM5NywicGF0aCI6Ii8zNzA2MjA0MS8zOTQ5Njc2NDItZDI1MGJlZDAtZGNjOC00MDNmLThlYWUtMzRhNzE5MGUzZTFlLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNTAyMTAlMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjUwMjEwVDA0Mzk1N1omWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPThkYzJhOWQ2N2FhNDA1ZGI0YzU5ZTJjNTk0YWI3MTRkZDI1YzM3YWJhODJjZTFiMWM0MzBlZDIwM2ExYTAzNzImWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0In0.kAwn9NMKcqN32eP-ZAYZXbfRrv_ZRKe_4FGxhxTX5ZQ)
How to use it
Set the
DATE_FORMAT_IN_EMAIL_SUBJECT=True
to allow users to include a date format in the email subject, which will automatically be replaced with the corresponding actual date.available date format https://strftime.org/
Example
In this example i defined Year-Day-Minutes
Year - %Y
Day - %D
Minutes - %M
Output
ADDITIONAL INFORMATION