feat: make CTA text in Alerts & Reports mails configurable (#19779)

This commit is contained in:
Cemre Mengu 2023-01-10 21:52:54 +03:00 committed by GitHub
parent 08f45ef207
commit 0b22287ad9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 1 deletions

View File

@ -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

View File

@ -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