email_base.html 7.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214
  1. {% load static settings %}
  2. <!-- Based on Cerberus email templates: https://www.cerberusemail.com/templates -->
  3. <!DOCTYPE html>
  4. <html lang="en" xmlns="http://www.w3.org/1999/xhtml" xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office">
  5. <head>
  6. <meta charset="utf-8"> <!-- utf-8 works for most cases -->
  7. <meta name="viewport" content="width=device-width"> <!-- Forcing initial-scale shouldn't be necessary -->
  8. <meta http-equiv="X-UA-Compatible" content="IE=edge"> <!-- Use the latest (edge) version of IE rendering engine -->
  9. <meta name="x-apple-disable-message-reformatting"> <!-- Disable auto-scale in iOS 10 Mail entirely -->
  10. <meta name="format-detection" content="telephone=no,address=no,email=no,date=no,url=no"> <!-- Tell iOS not to automatically link certain text strings. -->
  11. <meta name="color-scheme" content="light dark">
  12. <meta name="supported-color-schemes" content="light dark">
  13. <title>
  14. {% block title_text %}{% endblock %}
  15. </title> <!-- The title tag shows in email notifications, like Android 4.4. -->
  16. <!-- CSS Reset : BEGIN -->
  17. <style>
  18. /* What it does: Tells the email client that both light and dark styles are provided. A duplicate of meta color-scheme meta tag above. */
  19. :root {
  20. color-scheme: light dark;
  21. supported-color-schemes: light dark;
  22. }
  23. /* What it does: Remove spaces around the email design added by some email clients. */
  24. /* Beware: It can remove the padding / margin and add a background color to the compose a reply window. */
  25. html,
  26. body {
  27. margin: 0 auto !important;
  28. padding: 0 !important;
  29. height: 100% !important;
  30. width: 100% !important;
  31. }
  32. /* What it does: Stops email clients resizing small text. */
  33. * {
  34. -ms-text-size-adjust: 100%;
  35. -webkit-text-size-adjust: 100%;
  36. }
  37. /* What it does: Centers email on Android 4.4 */
  38. div[style*="margin: 16px 0"] {
  39. margin: 0 !important;
  40. }
  41. /* What it does: forces Samsung Android mail clients to use the entire viewport */
  42. #MessageViewBody, #MessageWebViewDiv{
  43. width: 100% !important;
  44. }
  45. /* What it does: Stops Outlook from adding extra spacing to tables. */
  46. table,
  47. td {
  48. mso-table-lspace: 0pt !important;
  49. mso-table-rspace: 0pt !important;
  50. }
  51. /* What it does: Fixes webkit padding issue. */
  52. table {
  53. border-spacing: 0 !important;
  54. border-collapse: collapse !important;
  55. table-layout: fixed !important;
  56. margin: 0 auto !important;
  57. }
  58. /* What it does: Uses a better rendering method when resizing images in IE. */
  59. img {
  60. -ms-interpolation-mode:bicubic;
  61. }
  62. /* What it does: Prevents Windows 10 Mail from underlining links despite inline CSS. Styles for underlined links should be inline. */
  63. a {
  64. text-decoration: none;
  65. }
  66. /* What it does: A work-around for email clients meddling in triggered links. */
  67. a[x-apple-data-detectors], /* iOS */
  68. .unstyle-auto-detected-links a,
  69. .aBn {
  70. border-bottom: 0 !important;
  71. cursor: default !important;
  72. color: inherit !important;
  73. text-decoration: none !important;
  74. font-size: inherit !important;
  75. font-family: inherit !important;
  76. font-weight: inherit !important;
  77. line-height: inherit !important;
  78. }
  79. /* What it does: Prevents Gmail from displaying a download button on large, non-linked images. */
  80. .a6S {
  81. display: none !important;
  82. opacity: 0.01 !important;
  83. }
  84. /* What it does: Prevents Gmail from changing the text color in conversation threads. */
  85. .im {
  86. color: inherit !important;
  87. }
  88. /* If the above doesn't work, add a .g-img class to any image in question. */
  89. img.g-img + div {
  90. display: none !important;
  91. }
  92. /* What it does: Removes right gutter in Gmail iOS app: https://github.com/TedGoas/Cerberus/issues/89 */
  93. /* Create one of these media queries for each additional viewport size you'd like to fix */
  94. /* iPhone 4, 4S, 5, 5S, 5C, and 5SE */
  95. @media only screen and (min-device-width: 320px) and (max-device-width: 374px) {
  96. u ~ div .email-container {
  97. min-width: 320px !important;
  98. }
  99. }
  100. /* iPhone 6, 6S, 7, 8, and X */
  101. @media only screen and (min-device-width: 375px) and (max-device-width: 413px) {
  102. u ~ div .email-container {
  103. min-width: 375px !important;
  104. }
  105. }
  106. /* iPhone 6+, 7+, and 8+ */
  107. @media only screen and (min-device-width: 414px) {
  108. u ~ div .email-container {
  109. min-width: 414px !important;
  110. }
  111. }
  112. </style>
  113. <!-- CSS Reset : END -->
  114. <!-- Progressive Enhancements : BEGIN -->
  115. <style>
  116. @media screen and (max-width: 600px) {
  117. /* What it does: Adjust typography on small screens to improve readability */
  118. .email-container {
  119. p, li{
  120. font-size: 17px !important;
  121. }
  122. }
  123. }
  124. </style>
  125. <!-- Progressive Enhancements : END -->
  126. </head>
  127. <!--
  128. The email background color is defined in three places:
  129. 1. body tag: for most email clients
  130. 2. center tag: for Gmail and Inbox mobile apps and web versions of Gmail, GSuite, Inbox, Yahoo, AOL, Libero, Comcast, freenet, Mail.ru, Orange.fr
  131. 3. mso conditional: For Windows 10 Mail
  132. -->
  133. <body width="100%" style="margin: 0; padding: 0 !important; mso-line-height-rule: exactly; background-color: #fafafa;" class="email-bg">
  134. <center role="article" aria-roledescription="email" lang="en" style="width: 100%; background-color: #fafafa;" class="email-bg">
  135. <!--[if mso | IE]>
  136. <table role="presentation" border="0" cellpadding="0" cellspacing="0" width="100%" style="background-color: #fafafa;" class="email-bg">
  137. <tr>
  138. <td>
  139. <![endif]-->
  140. <!--
  141. Set the email width. Defined in two places:
  142. 1. max-width for all clients except Desktop Windows Outlook, allowing the email to squish on narrow but never go wider than 600px.
  143. 2. MSO tags for Desktop Windows Outlook enforce a 600px width.
  144. -->
  145. <div style="max-width: 600px; margin: 0 auto;" class="email-container">
  146. <!--[if mso]>
  147. <table align="center" role="presentation" cellspacing="0" cellpadding="0" border="0" width="600">
  148. <tr>
  149. <td>
  150. <![endif]-->
  151. <!-- Email Body : BEGIN -->
  152. <table align="center" role="presentation" cellspacing="0" cellpadding="0" border="0" width="100%" style="margin: auto;">
  153. <!-- Email Header : BEGIN -->
  154. <tr>
  155. <td style="padding: 20px 0 12px 0; text-align: left">
  156. <img src="{% get_domain %}{% static 'images/logo.png' %}" width="200" height="50" alt="alt_text" border="0" style="height: auto; background: #fafafa;">
  157. </td>
  158. </tr>
  159. <!-- Email Header : END -->
  160. <tr>
  161. <td style="background-color: #fefefe;" class="darkmode-bg">
  162. <table role="presentation" cellspacing="0" cellpadding="0" width="100%">
  163. {% block content %}{% endblock %}
  164. </table>
  165. </td>
  166. </tr>
  167. </table>
  168. <!-- Email Body : END -->
  169. <!--[if mso]>
  170. </td>
  171. </tr>
  172. </table>
  173. <![endif]-->
  174. </div>
  175. <!--[if mso | IE]>
  176. </td>
  177. </tr>
  178. </table>
  179. <![endif]-->
  180. </center>
  181. </body>
  182. </html>