-
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: updated email format for SQL-based email alerts #10512
Conversation
superset/tasks/schedules.py
Outdated
@@ -602,10 +604,16 @@ def deliver_alert(alert: Alert, recipients: Optional[str] = None) -> None: | |||
textwrap.dedent( | |||
"""\ | |||
<h2>Alert: %(label)s</h2> | |||
<img src="cid:screenshot" alt="%(label)s" /> | |||
<p><b>SQL Statement: </b>%(sql)s</p> | |||
<p>Click <a href="%(image_url)s">here</a> or the image below |
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.
you can probably do even better here:
https://stackoverflow.com/questions/17245895/how-to-format-text-in-email-when-using-smtp
e.g.
- highlight sql section & use separate font
- show the result returned
- use red color
- have a link to the alert history
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.
also template may live separately, e.g. https://github.com/apache/incubator-superset/blob/master/superset/templates/email/role_extended.txt
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.
I'll leave show the result returned
as a TODO
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.
let's do couple more small improvements to the message
df15ae9
to
514fff8
Compare
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.
LG%nits
* added sql statement and link to chart in alert email * pylint * updated email to include link to alert * style changes * pylint * added todo and fixed formatting of email Co-authored-by: Jason Davis <@dropbox.com>
* added sql statement and link to chart in alert email * pylint * updated email to include link to alert * style changes * pylint * added todo and fixed formatting of email Co-authored-by: Jason Davis <@dropbox.com>
SUMMARY
Added the relevant SQL statement and a link to the relevant slice for SQL-based email alerts.
BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF
Before:
After:
TEST PLAN
ADDITIONAL INFORMATION