diff --git a/superset/reports/commands/execute.py b/superset/reports/commands/execute.py index 1e16c41880..8712532738 100644 --- a/superset/reports/commands/execute.py +++ b/superset/reports/commands/execute.py @@ -219,7 +219,12 @@ class BaseReportState: f"{self._report_schedule.name}: " f"{self._report_schedule.dashboard.dashboard_title}" ) - return NotificationContent(name=name, url=url, screenshot=screenshot_data) + return NotificationContent( + name=name, + url=url, + screenshot=screenshot_data, + description=self._report_schedule.description, + ) def _send(self, notification_content: NotificationContent) -> None: """ diff --git a/superset/reports/notifications/__init__.py b/superset/reports/notifications/__init__.py index 2553053131..dae43d64c7 100644 --- a/superset/reports/notifications/__init__.py +++ b/superset/reports/notifications/__init__.py @@ -22,7 +22,7 @@ from superset.reports.notifications.slack import SlackNotification def create_notification( - recipient: ReportRecipients, screenshot_data: NotificationContent + recipient: ReportRecipients, notification_content: NotificationContent ) -> BaseNotification: """ Notification polymorphic factory @@ -30,5 +30,5 @@ def create_notification( """ for plugin in BaseNotification.plugins: if plugin.type == recipient.type: - return plugin(recipient, screenshot_data) + return plugin(recipient, notification_content) raise Exception("Recipient type not supported") diff --git a/superset/reports/notifications/base.py b/superset/reports/notifications/base.py index 0cd8dba86a..60f5f0a0eb 100644 --- a/superset/reports/notifications/base.py +++ b/superset/reports/notifications/base.py @@ -27,6 +27,7 @@ class NotificationContent: url: Optional[str] = None # url to chart/dashboard for this screenshot screenshot: Optional[bytes] = None # bytes for the screenshot text: Optional[str] = None + description: Optional[str] = "" class BaseNotification: # pylint: disable=too-few-public-methods diff --git a/superset/reports/notifications/email.py b/superset/reports/notifications/email.py index a3adfbc7f4..09023f92d9 100644 --- a/superset/reports/notifications/email.py +++ b/superset/reports/notifications/email.py @@ -68,9 +68,11 @@ class EmailNotification(BaseNotification): # pylint: disable=too-few-public-met msgid = make_msgid(domain)[1:-1] body = __( """ +
%(description)s
Explore in Superset