discourse/app/views/email/default_template.html
David Battersby 17e6ea96ab
UX: add preview to email templates (#36657)
Adds a preview text to the beginning of the email body based on user
notification type. The value is taken from the translation key, which
can be customized for each email within Admin -> Appearance -> Site
Texts (ie. translation overrides).

For html emails this preview text is hidden with `display: none` to
prevent it appearing within the body of the email. For the plain text
version of the email it will appear within the body of the email.

Co-authored-by: Martin Brennan <martin@discourse.org>
2026-01-08 11:33:53 +04:00

53 lines
1.3 KiB
HTML
Vendored

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html
xmlns="http://www.w3.org/1999/xhtml"
lang="%{html_lang}"
xml:lang="%{html_lang}"
>
<head>
<meta
http-equiv="Content-type"
name="viewport"
content="initial-scale=1.0, maximum-scale=1.0, user-scalable=no, width=device-width"
/>
%{dark_mode_meta_tags}
<!-- prevent ios zooming + autoscaling -->
<meta name="x-apple-disable-message-reformatting" />
<title></title>
</head>
<body>
<!--[if mso]>
<style type="text/css">
body,
table,
td,
th,
h1,
h2,
h3 {
font-family: Arial, sans-serif !important;
}
</style>
<![endif]-->
<div style='display: none'>%{email_preview}</div>
%{email_content}
<!-- prevent Gmail on iOS font size manipulation -->
<div
style="
display: none;
white-space: nowrap;
font: 15px courier;
line-height: 0;
"
>
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
</div>
%{dark_mode_styles}
</body>
</html>