-
Notifications
You must be signed in to change notification settings - Fork 14.2k
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
base: master
Are you sure you want to change the base?
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 0 83.77% +83.77%
===========================================
Files 0 538 +538
Lines 0 39153 +39153
===========================================
+ Hits 0 32801 +32801
- Misses 0 6352 +6352
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
@@ -563,6 +563,8 @@ class D3TimeFormat(TypedDict, total=False): | |||
# If on, you'll want to add "https://avatars.slack-edge.com" to the list of allowed | |||
# domains in your TALISMAN_CONFIG | |||
"SLACK_ENABLE_AVATARS": False, | |||
# Allow users to optionally specify date formats in email subjects, which will be parsed if enabled. | |||
"DATE_FORMAT_IN_EMAIL_SUBJECT": False, |
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.
Can you mention this new feature flag in UPDATING.md
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.
thanks for reviewing! i have updated
@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 |
RESOURCES/FEATURE_FLAGS.md
Outdated
@@ -46,7 +46,8 @@ These features are **finished** but currently being tested. They are usable, but | |||
- CONFIRM_DASHBOARD_DIFF | |||
- DRILL_TO_DETAIL | |||
- DYNAMIC_PLUGINS | |||
- ENABLE_SUPERSET_META_DB: [(docs)](https://superset.apache.org/docs/configuration/databases/#querying-across-databases) | |||
- DATE_FORMAT_IN_EMAIL_SUBJECT: [(docs)](https://superset.apache.org/docs/configuration/databases/#querying-across-databases) | |||
- ENABLE_SUPERSET_META_DB: [(docs)](https://github.com/apache/superset/pull/31413) |
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.
It looks like this docs link and the one above it are swapped.
Also, it would nice to add a docs entry rather than linking to the PR. You can run the docs locally and just add some markdown. Docs on how to do that are here.
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.
thanks for pointing me to the right direction! i have added an entry and updated the link
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
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
After
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