From 0b22287ad9f3908ce62f51e2a17de8975beafed2 Mon Sep 17 00:00:00 2001 From: Cemre Mengu Date: Tue, 10 Jan 2023 21:52:54 +0300 Subject: [PATCH] feat: make CTA text in Alerts & Reports mails configurable (#19779) --- superset/config.py | 3 +++ superset/reports/notifications/email.py | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/superset/config.py b/superset/config.py index a3fc3df00..64ff09a5c 100644 --- a/superset/config.py +++ b/superset/config.py @@ -1259,6 +1259,9 @@ ALERT_REPORTS_QUERY_EXECUTION_MAX_TRIES = 1 # A custom prefix to use on all Alerts & Reports emails EMAIL_REPORTS_SUBJECT_PREFIX = "[Report] " +# The text for call-to-action link in Alerts & Reports emails +EMAIL_REPORTS_CTA = "Explore in Superset" + # Slack API token for the superset reports, either string or callable SLACK_API_TOKEN: Optional[Union[Callable[[], str], str]] = None SLACK_PROXY = None diff --git a/superset/reports/notifications/email.py b/superset/reports/notifications/email.py index f8b38cc3e..4b061c8ef 100644 --- a/superset/reports/notifications/email.py +++ b/superset/reports/notifications/email.py @@ -128,7 +128,7 @@ class EmailNotification(BaseNotification): # pylint: disable=too-few-public-met else: html_table = "" - call_to_action = __("Explore in Superset") + call_to_action = __(app.config["EMAIL_REPORTS_CTA"]) url = ( modify_url_query(self._content.url, standalone="0") if self._content.url is not None