BaseWithHeaderEmailLayout.mjs 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394
  1. import _ from 'lodash'
  2. import settings from '@overleaf/settings'
  3. export default _.template(`\
  4. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
  5. "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  6. <html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en" style="Margin: 0; background: #E4E8EE !important; margin: 0; min-height: 100%; padding: 0;">
  7. <head>
  8. <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
  9. <meta name="viewport" content="width=device-width">
  10. <style>.button td {
  11. border-radius: 9999px; }
  12. .force-overleaf-style a,
  13. .force-overleaf-style a[href] {
  14. color: #138A07 !important;
  15. text-decoration: none !important;
  16. -moz-hyphens: none;
  17. -ms-hyphens: none;
  18. -webkit-hyphens: none;
  19. hyphens: none; }
  20. .force-overleaf-style a:visited,
  21. .force-overleaf-style a[href]:visited {
  22. color: #138A07; }
  23. .force-overleaf-style a:hover,
  24. .force-overleaf-style a[href]:hover {
  25. color: #3d7935; }
  26. .force-overleaf-style a:active,
  27. .force-overleaf-style a[href]:active {
  28. color: #3d7935; }
  29. </style>
  30. <style>@media only screen {
  31. html {
  32. min-height: 100%;
  33. background: #f6f6f6;
  34. }
  35. }
  36. @media only screen and (max-width: 596px) {
  37. .small-float-center {
  38. margin: 0 auto !important;
  39. float: none !important;
  40. text-align: center !important;
  41. }
  42. .small-text-center {
  43. text-align: center !important;
  44. }
  45. .small-text-left {
  46. text-align: left !important;
  47. }
  48. .small-text-right {
  49. text-align: right !important;
  50. }
  51. .cta-table {
  52. table-layout: fixed;
  53. }
  54. }
  55. @media only screen and (max-width: 596px) {
  56. .hide-for-large {
  57. display: block !important;
  58. width: auto !important;
  59. overflow: visible !important;
  60. max-height: none !important;
  61. font-size: inherit !important;
  62. line-height: inherit !important;
  63. }
  64. }
  65. @media only screen and (max-width: 596px) {
  66. table.body table.container .hide-for-large,
  67. table.body table.container .row.hide-for-large {
  68. display: table !important;
  69. width: 100% !important;
  70. }
  71. }
  72. @media only screen and (max-width: 596px) {
  73. table.body table.container .callout-inner.hide-for-large {
  74. display: table-cell !important;
  75. width: 100% !important;
  76. }
  77. }
  78. @media only screen and (max-width: 596px) {
  79. table.body table.container .show-for-large {
  80. display: none !important;
  81. width: 0;
  82. mso-hide: all;
  83. overflow: hidden;
  84. }
  85. }
  86. @media only screen and (max-width: 596px) {
  87. table.body img {
  88. width: auto;
  89. height: auto;
  90. }
  91. table.body center {
  92. min-width: 0 !important;
  93. }
  94. table.body .container {
  95. width: 95% !important;
  96. }
  97. table.body .columns,
  98. table.body .column {
  99. height: auto !important;
  100. -moz-box-sizing: border-box;
  101. -webkit-box-sizing: border-box;
  102. box-sizing: border-box;
  103. padding-left: 16px !important;
  104. padding-right: 16px !important;
  105. }
  106. table.body .columns .column,
  107. table.body .columns .columns,
  108. table.body .column .column,
  109. table.body .column .columns {
  110. padding-left: 0 !important;
  111. padding-right: 0 !important;
  112. }
  113. table.body .collapse .columns,
  114. table.body .collapse .column {
  115. padding-left: 0 !important;
  116. padding-right: 0 !important;
  117. }
  118. td.small-1,
  119. th.small-1 {
  120. display: inline-block !important;
  121. width: 8.33333% !important;
  122. }
  123. td.small-2,
  124. th.small-2 {
  125. display: inline-block !important;
  126. width: 16.66667% !important;
  127. }
  128. td.small-3,
  129. th.small-3 {
  130. display: inline-block !important;
  131. width: 25% !important;
  132. }
  133. td.small-4,
  134. th.small-4 {
  135. display: inline-block !important;
  136. width: 33.33333% !important;
  137. }
  138. td.small-5,
  139. th.small-5 {
  140. display: inline-block !important;
  141. width: 41.66667% !important;
  142. }
  143. td.small-6,
  144. th.small-6 {
  145. display: inline-block !important;
  146. width: 50% !important;
  147. }
  148. td.small-7,
  149. th.small-7 {
  150. display: inline-block !important;
  151. width: 58.33333% !important;
  152. }
  153. td.small-8,
  154. th.small-8 {
  155. display: inline-block !important;
  156. width: 66.66667% !important;
  157. }
  158. td.small-9,
  159. th.small-9 {
  160. display: inline-block !important;
  161. width: 75% !important;
  162. }
  163. td.small-10,
  164. th.small-10 {
  165. display: inline-block !important;
  166. width: 83.33333% !important;
  167. }
  168. td.small-11,
  169. th.small-11 {
  170. display: inline-block !important;
  171. width: 91.66667% !important;
  172. }
  173. td.small-12,
  174. th.small-12 {
  175. display: inline-block !important;
  176. width: 100% !important;
  177. }
  178. .columns td.small-12,
  179. .column td.small-12,
  180. .columns th.small-12,
  181. .column th.small-12 {
  182. display: block !important;
  183. width: 100% !important;
  184. }
  185. table.body td.small-offset-1,
  186. table.body th.small-offset-1 {
  187. margin-left: 8.33333% !important;
  188. Margin-left: 8.33333% !important;
  189. }
  190. table.body td.small-offset-2,
  191. table.body th.small-offset-2 {
  192. margin-left: 16.66667% !important;
  193. Margin-left: 16.66667% !important;
  194. }
  195. table.body td.small-offset-3,
  196. table.body th.small-offset-3 {
  197. margin-left: 25% !important;
  198. Margin-left: 25% !important;
  199. }
  200. table.body td.small-offset-4,
  201. table.body th.small-offset-4 {
  202. margin-left: 33.33333% !important;
  203. Margin-left: 33.33333% !important;
  204. }
  205. table.body td.small-offset-5,
  206. table.body th.small-offset-5 {
  207. margin-left: 41.66667% !important;
  208. Margin-left: 41.66667% !important;
  209. }
  210. table.body td.small-offset-6,
  211. table.body th.small-offset-6 {
  212. margin-left: 50% !important;
  213. Margin-left: 50% !important;
  214. }
  215. table.body td.small-offset-7,
  216. table.body th.small-offset-7 {
  217. margin-left: 58.33333% !important;
  218. Margin-left: 58.33333% !important;
  219. }
  220. table.body td.small-offset-8,
  221. table.body th.small-offset-8 {
  222. margin-left: 66.66667% !important;
  223. Margin-left: 66.66667% !important;
  224. }
  225. table.body td.small-offset-9,
  226. table.body th.small-offset-9 {
  227. margin-left: 75% !important;
  228. Margin-left: 75% !important;
  229. }
  230. table.body td.small-offset-10,
  231. table.body th.small-offset-10 {
  232. margin-left: 83.33333% !important;
  233. Margin-left: 83.33333% !important;
  234. }
  235. table.body td.small-offset-11,
  236. table.body th.small-offset-11 {
  237. margin-left: 91.66667% !important;
  238. Margin-left: 91.66667% !important;
  239. }
  240. table.body table.columns td.expander,
  241. table.body table.columns th.expander {
  242. display: none !important;
  243. }
  244. table.body .right-text-pad,
  245. table.body .text-pad-right {
  246. padding-left: 10px !important;
  247. }
  248. table.body .left-text-pad,
  249. table.body .text-pad-left {
  250. padding-right: 10px !important;
  251. }
  252. table.menu {
  253. width: 100% !important;
  254. }
  255. table.menu td,
  256. table.menu th {
  257. width: auto !important;
  258. display: inline-block !important;
  259. }
  260. table.menu.vertical td,
  261. table.menu.vertical th,
  262. table.menu.small-vertical td,
  263. table.menu.small-vertical th {
  264. display: block !important;
  265. }
  266. table.menu[align="center"] {
  267. width: auto !important;
  268. }
  269. table.button.small-expand,
  270. table.button.small-expanded {
  271. width: 100% !important;
  272. }
  273. table.button.small-expand table,
  274. table.button.small-expanded table {
  275. width: 100%;
  276. }
  277. table.button.small-expand table a,
  278. table.button.small-expanded table a {
  279. text-align: center !important;
  280. width: 100% !important;
  281. padding-left: 0 !important;
  282. padding-right: 0 !important;
  283. }
  284. table.button.small-expand center,
  285. table.button.small-expanded center {
  286. min-width: 0;
  287. }
  288. }</style>
  289. </head>
  290. <body leftmargin="0" topmargin="0" marginwidth="0" marginheight="0" bgcolor="#F6F6F6" style="-moz-box-sizing: border-box; -ms-text-size-adjust: 100%; -webkit-box-sizing: border-box; -webkit-text-size-adjust: 100%; Margin: 0; box-sizing: border-box; color: #5D6879; font-family: Helvetica, Arial, sans-serif; font-size: 16px; font-weight: normal; line-height: 1.3; margin: 0; min-width: 100%; padding: 0; text-align: left; width: 100% !important;">
  291. <!-- <span class="preheader"></span> -->
  292. <table class="body" border="0" cellspacing="0" cellpadding="0" width="100%" height="100%" style="Margin: 0; background: #E4E8EE; border-collapse: collapse; border-spacing: 0; color: #5D6879; font-family: Helvetica, Arial, sans-serif; font-size: 16px; font-weight: normal; height: 100%; line-height: 1.3; margin: 0; padding: 0; text-align: left; vertical-align: top; width: 100%;">
  293. <tr style="padding: 0; text-align: left; vertical-align: top;">
  294. <td class="body-cell" align="center" valign="top" bgcolor="#F6F6F6" style="-moz-hyphens: auto; -webkit-hyphens: auto; Margin: 0; background: #E4E8EE !important; border-collapse: collapse !important; color: #5D6879; font-family: Helvetica, Arial, sans-serif; font-size: 16px; font-weight: normal; hyphens: auto; line-height: 1.3; margin: 0; padding: 0; padding-bottom: 20px; text-align: left; vertical-align: top; word-wrap: break-word;">
  295. <center data-parsed="" style="min-width: 580px; width: 100%;">
  296. <table align="center" class="wrapper header float-center" style="Margin: 0 auto; background: #1E2530; border-bottom: none; border-collapse: collapse; border-spacing: 0; float: none; margin: 0 auto; padding: 0; text-align: center; vertical-align: top; width: 100%;"><tr style="padding: 0; text-align: left; vertical-align: top;"><td class="wrapper-inner" style="-moz-hyphens: auto; -webkit-hyphens: auto; Margin: 0; border-collapse: collapse !important; color: #5D6879; font-family: Helvetica, Arial, sans-serif; font-size: 16px; font-weight: normal; hyphens: auto; line-height: 1.3; margin: 0; padding: 20px; text-align: left; vertical-align: top; word-wrap: break-word;">
  297. <table align="center" class="container" style="Margin: 0 auto; background: transparent; border-collapse: collapse; border-spacing: 0; margin: 0 auto; padding: 0; text-align: inherit; vertical-align: top; width: 580px;"><tbody><tr style="padding: 0; text-align: left; vertical-align: top;"><td style="-moz-hyphens: auto; -webkit-hyphens: auto; Margin: 0; border-collapse: collapse !important; color: #5D6879; font-family: Helvetica, Arial, sans-serif; font-size: 16px; font-weight: normal; hyphens: auto; line-height: 1.3; margin: 0; padding: 0; text-align: left; vertical-align: top; word-wrap: break-word;">
  298. <table class="row collapse" style="border-collapse: collapse; border-spacing: 0; display: table; padding: 0; position: relative; text-align: left; vertical-align: top; width: 100%;"><tbody><tr style="padding: 0; text-align: left; vertical-align: top;">
  299. <th class="small-12 large-12 columns first last" style="Margin: 0 auto; color: #5D6879; font-family: Helvetica, Arial, sans-serif; font-size: 16px; font-weight: normal; line-height: 1.3; margin: 0 auto; padding: 0; padding-bottom: 0; padding-left: 0; padding-right: 0; text-align: left; width: 588px;"><table style="border-collapse: collapse; border-spacing: 0; padding: 0; text-align: left; vertical-align: top; width: 100%;"><tr style="padding: 0; text-align: left; vertical-align: top;"><th style="Margin: 0; color: #5D6879; font-family: Helvetica, Arial, sans-serif; font-size: 16px; font-weight: normal; line-height: 1.3; margin: 0; padding: 0; text-align: left;">
  300. <h1 style="Margin: 0; Margin-bottom: px; color: #FFFFFF; font-family: Georgia, serif; font-size: 30px; font-weight: normal; line-height: 1.3; margin: 0; margin-bottom: px; padding: 0; text-align: left; word-wrap: normal;">
  301. ${settings.appName}
  302. </h1>
  303. </th>
  304. <th class="expander" style="Margin: 0; color: #5D6879; font-family: Helvetica, Arial, sans-serif; font-size: 16px; font-weight: normal; line-height: 1.3; margin: 0; padding: 0 !important; text-align: left; visibility: hidden; width: 0;"></th></tr></table></th>
  305. </tr></tbody></table>
  306. </td></tr></tbody></table>
  307. </td></tr></table>
  308. <table class="spacer float-center" style="Margin: 0 auto; border-collapse: collapse; border-spacing: 0; float: none; margin: 0 auto; padding: 0; text-align: center; vertical-align: top; width: 100%;"><tbody><tr style="padding: 0; text-align: left; vertical-align: top;"><td height="20px" style="-moz-hyphens: auto; -webkit-hyphens: auto; Margin: 0; border-collapse: collapse !important; color: #5D6879; font-family: Helvetica, Arial, sans-serif; font-size: 20px; font-weight: normal; hyphens: auto; line-height: 20px; margin: 0; mso-line-height-rule: exactly; padding: 0; text-align: left; vertical-align: top; word-wrap: break-word;">&#xA0;</td></tr></tbody></table>
  309. <table align="center" class="container main float-center" style="Margin: 0 auto; Margin-top: 10px; background: #FFFFFF; border-collapse: collapse; border-spacing: 0; float: none; margin: 0 auto; margin-top: 10px; padding: 0; text-align: center; vertical-align: top; width: 580px;"><tbody><tr style="padding: 0; text-align: left; vertical-align: top;"><td style="-moz-hyphens: auto; -webkit-hyphens: auto; Margin: 0; border-collapse: collapse !important; color: #5D6879; font-family: Helvetica, Arial, sans-serif; font-size: 16px; font-weight: normal; hyphens: auto; line-height: 1.3; margin: 0; padding: 0; text-align: left; vertical-align: top; word-wrap: break-word;">
  310. <table class="spacer" style="border-collapse: collapse; border-spacing: 0; padding: 0; text-align: left; vertical-align: top; width: 100%;"><tbody><tr style="padding: 0; text-align: left; vertical-align: top;"><td height="20px" style="-moz-hyphens: auto; -webkit-hyphens: auto; Margin: 0; border-collapse: collapse !important; color: #5D6879; font-family: Helvetica, Arial, sans-serif; font-size: 20px; font-weight: normal; hyphens: auto; line-height: 20px; margin: 0; mso-line-height-rule: exactly; padding: 0; text-align: left; vertical-align: top; word-wrap: break-word;">&#xA0;</td></tr></tbody></table>
  311. <%= body %>
  312. <table class="wrapper secondary" align="center" style="background: #E4E8EE; border-collapse: collapse; border-spacing: 0; padding: 0; text-align: left; vertical-align: top; width: 100%;"><tr style="padding: 0; text-align: left; vertical-align: top;"><td class="wrapper-inner" style="-moz-hyphens: auto; -webkit-hyphens: auto; Margin: 0; border-collapse: collapse !important; color: #5D6879; font-family: Helvetica, Arial, sans-serif; font-size: 16px; font-weight: normal; hyphens: auto; line-height: 1.3; margin: 0; padding: 0; text-align: left; vertical-align: top; word-wrap: break-word;">
  313. <table class="spacer" style="border-collapse: collapse; border-spacing: 0; padding: 0; text-align: left; vertical-align: top; width: 100%;"><tbody><tr style="padding: 0; text-align: left; vertical-align: top;"><td height="10px" style="-moz-hyphens: auto; -webkit-hyphens: auto; Margin: 0; border-collapse: collapse !important; color: #5D6879; font-family: Helvetica, Arial, sans-serif; font-size: 10px; font-weight: normal; hyphens: auto; line-height: 10px; margin: 0; mso-line-height-rule: exactly; padding: 0; text-align: left; vertical-align: top; word-wrap: break-word;">&#xA0;</td></tr></tbody></table>
  314. <p style="Margin: 0; Margin-bottom: 10px; color: #5D6879; font-family: Helvetica, Arial, sans-serif; font-size: 16px; font-weight: normal; line-height: 1.3; margin: 0; margin-bottom: 10px; padding: 0; text-align: left;"><small style="color: #5D6879; font-size: 80%;">
  315. ${
  316. settings.email &&
  317. settings.email.template &&
  318. settings.email.template.customFooter
  319. ? `${settings.email.template.customFooter}<br>`
  320. : ''
  321. }${settings.appName} &bull; <a href="${
  322. settings.siteUrl
  323. }" style="Margin: 0; color: #0F7A06; font-family: Helvetica, Arial, sans-serif; font-weight: normal; line-height: 1.3; margin: 0; padding: 0; text-align: left; text-decoration: none;">${
  324. settings.siteUrl
  325. }</a>
  326. </small></p>
  327. </td></tr></table>
  328. </td></tr></tbody></table>
  329. </center>
  330. </td>
  331. </tr>
  332. </table>
  333. <!-- prevent Gmail on iOS font size manipulation -->
  334. <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>
  335. </body>
  336. </html>\
  337. `)