diff --git a/client/app/pages/alert/AlertEdit.jsx b/client/app/pages/alert/AlertEdit.jsx index 64bff87631..be3446c3ac 100644 --- a/client/app/pages/alert/AlertEdit.jsx +++ b/client/app/pages/alert/AlertEdit.jsx @@ -103,6 +103,8 @@ export default class AlertEdit extends React.Component { setSubject={subject => onNotificationTemplateChange({ custom_subject: subject })} body={options.custom_body} setBody={body => onNotificationTemplateChange({ custom_body: body })} + allowHtml={options.allow_html} + setAllowHtml={allowHtml => onNotificationTemplateChange({ allow_html: allowHtml })} /> diff --git a/client/app/pages/alert/AlertNew.jsx b/client/app/pages/alert/AlertNew.jsx index 9e128ed2fc..1392b8ceeb 100644 --- a/client/app/pages/alert/AlertNew.jsx +++ b/client/app/pages/alert/AlertNew.jsx @@ -70,6 +70,8 @@ export default class AlertNew extends React.Component { setSubject={subject => onNotificationTemplateChange({ custom_subject: subject })} body={options.custom_body} setBody={body => onNotificationTemplateChange({ custom_body: body })} + allowHtml={options.allow_html} + setAllowHtml={allowHtml => onNotificationTemplateChange({ allow_html: allowHtml })} /> diff --git a/client/app/pages/alert/components/NotificationTemplate.jsx b/client/app/pages/alert/components/NotificationTemplate.jsx index 5aa750207b..173c88f887 100644 --- a/client/app/pages/alert/components/NotificationTemplate.jsx +++ b/client/app/pages/alert/components/NotificationTemplate.jsx @@ -4,12 +4,14 @@ import { head, isEmpty, isNull, isUndefined } from "lodash"; import Mustache from "mustache"; import HelpTrigger from "@/components/HelpTrigger"; +import Tooltip from "@/components/Tooltip"; import { Alert as AlertType, Query as QueryType } from "@/components/proptypes"; import Input from "antd/lib/input"; import Select from "antd/lib/select"; import Modal from "antd/lib/modal"; import Switch from "antd/lib/switch"; +import Checkbox from "antd/lib/checkbox"; import "./NotificationTemplate.less"; @@ -30,7 +32,18 @@ function normalizeCustomTemplateData(alert, query, columnNames, resultValues) { }; } -function NotificationTemplate({ alert, query, columnNames, resultValues, subject, setSubject, body, setBody }) { +function NotificationTemplate({ + alert, + query, + columnNames, + resultValues, + subject, + setSubject, + body, + setBody, + allowHtml, + setAllowHtml, +}) { const hasContent = !!(subject || body); const [enabled, setEnabled] = useState(hasContent ? 1 : 0); const [showPreview, setShowPreview] = useState(false); @@ -49,6 +62,7 @@ function NotificationTemplate({ alert, query, columnNames, resultValues, subject onOk: () => { setSubject(null); setBody(null); + setAllowHtml(false); setEnabled(value); setShowPreview(false); }, @@ -100,6 +114,16 @@ function NotificationTemplate({ alert, query, columnNames, resultValues, subject