Dynamic Date/Timestamp Variables in Subscription Email Subject
- Dominant language
- Clojure
- Stars
- 49.3k
- Forks
- 6.8k
- Avg merge
- 1d 13h
- Merged PRs (30d)
- 653
Description
**Describe the solution you'd like**
This feature request proposes adding dynamic date/timestamp variables that can be used in report subjects, allowing for automated, time-sensitive naming. The variables should represent the start and end of the reporting period.
Two variations are needed:
1. Single Period Variable: For reports covering a single, defined period.
- {{timestamp}}: Start of the hour. Example: {{timestamp}} Acme Hourly Business Report (e.g., 2024-10-27 10:00:00 Acme Hourly Business Report)
- {{date}}: Start of the day. Example: {{date}} Acme Daily Business Report (e.g., 2024-10-27 Acme Daily Business Report)
- {{week}}: Start of the week (e.g., Monday). Example: {{week}} Acme Weekly Business Report (e.g., 2024-10-21 Acme Weekly Business Report)
- {{month}}: Start of the month. Example: {{month}} Acme Monthly Business Report (e.g., 2024-10-01 Acme Monthly Business Report)
2. Start/End Period Variables: For reports covering a range of time.
- {{start_timestamp}} - {{end_timestamp}}: Example: {{start_timestamp}} - {{end_timestamp}} Acme Hourly Business Report (e.g., 2024-10-27 10:00:00 - 2024-10-27 11:00:00 Acme Hourly Business Report)
- {{start_date}} - {{end_date}}: Example: {{start_date}} - {{end_date}} Acme Daily Business Report (e.g., 2024-10-26 - 2024-10-27 Acme Daily Business Report)
- {{start_week}} - {{end_week}}: Example: {{start_week}} - {{end_week}} Acme Weekly Business Report (e.g., 2024-10-21 - 2024-10-27 Acme Weekly Business Report)
- {{start_month}} - {{end_month}}: Example: {{start_month}} - {{end_month}} Acme Monthly Business Report (e.g., 2024-10-01 - 2024-10-31 Acme Monthly Business Report)
**Describe alternatives you've considered**
I explored using "Adding a header to text" with a data picker parameter called this_date. While this approach allows a default value of yesterday, the output is the string 'Yesterday.' It doesn't dynamically update the parameter with the actual date. Also, this method is unable to update the subject of the notification.
**How important is this feature to you?**
Fairly important. This feature has been requested by at least one other user ([Link](https://discourse.metabase.com/t/dashboard-subcrsiptions-include-date-and-time-in-email-subject/142158/1)). Dynamic report naming is crucial for organization and efficient retrieval of historical data.
**Additional context**
This feature would significantly improve the automation and usability of report generation. It would eliminate the need for manual subject line updates, reducing errors and saving time. Providing both single-period and start/end period variables offers flexibility for various reporting needs. Clear documentation on the date/time format used for each variable is essential.
Contributor guide
Research direction
No files, tests, or entry points are named. Start by locating the subscription notification subject handling and the report-period date logic, then determine how subject variables are resolved. Done means the requested single-period and start/end variables produce the documented dates in subscription email subjects, with the date and time formats documented.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- clojure
- Domain
- backend
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 32/100