Skip to content
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

Merged
merged 6 commits into from
Aug 4, 2020

Conversation

JasonD28
Copy link
Contributor

@JasonD28 JasonD28 commented Aug 4, 2020

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:
Screen Shot 2020-08-03 at 5 36 24 PM
After:
Screen Shot 2020-08-04 at 12 48 29 PM

TEST PLAN

  • local test
  • dropbox staging
  • dropbox production

ADDITIONAL INFORMATION

  • Has associated issue:
  • Changes UI

@@ -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
Copy link
Member

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

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Contributor Author

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

Copy link
Member

@bkyryliuk bkyryliuk left a 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

@pull-request-size pull-request-size bot added size/M and removed size/S labels Aug 4, 2020
@JasonD28 JasonD28 force-pushed the jdavis_alerting_email_ui branch from df15ae9 to 514fff8 Compare August 4, 2020 19:14
Copy link
Member

@bkyryliuk bkyryliuk left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LG%nits

superset/tasks/schedules.py Show resolved Hide resolved
superset/templates/email/alert.txt Show resolved Hide resolved
@bkyryliuk bkyryliuk merged commit aa479fb into apache:master Aug 4, 2020
Ofeknielsen pushed a commit to ofekisr/incubator-superset that referenced this pull request Oct 5, 2020
* 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>
auxten pushed a commit to auxten/incubator-superset that referenced this pull request Nov 20, 2020
* 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>
@mistercrunch mistercrunch added 🏷️ bot A label used by `supersetbot` to keep track of which PR where auto-tagged with release labels 🚢 0.38.0 labels Mar 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🏷️ bot A label used by `supersetbot` to keep track of which PR where auto-tagged with release labels size/M 🚢 0.38.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants