You are here

swiftmailer.html.twig in Open Social 8

The default template file for e-mails.

Available variables:

  • subject: The subject.
  • body: The message content.
  • message: The $message array created and used in the mail building procedure. Its content varies between cases, but typically contains at least the following elements:

    • id: The message identifier.
    • module: The module that handles the building of the message.
    • key: The key of the message.
    • to: The recipient email address.
    • from: The email address of the sender.
    • langcode: The langcode to use to compose the e-mail.
    • params: The message parameters.

This template may be overriden by module and/or mail key, using any of the following template names:

  • swiftmailer.html.twig: global, used by default.
  • swiftmailer--mymodule.html.twig: only emails sent by the module "mymodule".
  • swiftmailer--mymodule--test.html.twig: only emails by the module "mymodule" with key "test".

File

themes/socialbase/templates/swiftmailer.html.twig
View source
  1. {#
  2. /**
  3. * @file
  4. * The default template file for e-mails.
  5. *
  6. * Available variables:
  7. * - subject: The subject.
  8. * - body: The message content.
  9. * - message: The $message array created and used in the mail building
  10. * procedure. Its content varies between cases, but typically contains at
  11. * least the following elements:
  12. * - id: The message identifier.
  13. * - module: The module that handles the building of the message.
  14. * - key: The key of the message.
  15. * - to: The recipient email address.
  16. * - from: The email address of the sender.
  17. * - langcode: The langcode to use to compose the e-mail.
  18. * - params: The message parameters.
  19. *
  20. * This template may be overriden by module and/or mail key, using any of the
  21. * following template names:
  22. * - swiftmailer.html.twig: global, used by default.
  23. * - swiftmailer--mymodule.html.twig: only emails sent by the module "mymodule".
  24. * - swiftmailer--mymodule--test.html.twig: only emails by the module
  25. * "mymodule" with key "test".
  26. *
  27. * @see template_preprocess()
  28. * @see template_preprocess_swiftmailer()
  29. *
  30. * @ingroup themeable
  31. */
  32. #}
  33. <!doctype html>
  34. <html>
  35. <head>
  36. <meta name="viewport" content="width=device-width" />
  37. <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
  38. <title>Open Social</title>
  39. <style>
  40. /* -------------------------------------
  41. GLOBAL RESETS
  42. ------------------------------------- */
  43. img {
  44. border: none;
  45. -ms-interpolation-mode: bicubic;
  46. max-width: 100%; }
  47. body {
  48. background-color: #f6f6f6;
  49. font-family: sans-serif;
  50. -webkit-font-smoothing: antialiased;
  51. font-size: 14px;
  52. line-height: 1.4;
  53. margin: 0;
  54. padding: 0;
  55. -ms-text-size-adjust: 100%;
  56. -webkit-text-size-adjust: 100%; }
  57. table {
  58. border-collapse: separate;
  59. mso-table-lspace: 0pt;
  60. mso-table-rspace: 0pt;
  61. width: 100%; }
  62. table td {
  63. font-family: sans-serif;
  64. font-size: 14px;
  65. vertical-align: top; }
  66. em {
  67. font-style: normal;
  68. font-weight: bold; }
  69. /* -------------------------------------
  70. BODY & CONTAINER
  71. ------------------------------------- */
  72. .body {
  73. background-color: #f6f6f6;
  74. width: 100%; }
  75. /* Set a max-width, and make it display as block so it will automatically stretch to that width, but will also shrink down on a phone or something */
  76. .container {
  77. display: block;
  78. margin: 0 auto !important;
  79. /* makes it centered */
  80. max-width: 580px;
  81. padding: 10px;
  82. width: 580px; }
  83. /* This should also be a block element, so that it will fill 100% of the .container */
  84. .content {
  85. box-sizing: border-box;
  86. display: block;
  87. margin: 0 auto;
  88. max-width: 580px;
  89. padding: 10px; }
  90. /* -------------------------------------
  91. HEADER, FOOTER, MAIN
  92. ------------------------------------- */
  93. .header {
  94. padding-top: 30px;
  95. padding-bottom: 30px;
  96. text-align: center;
  97. }
  98. .postheader {
  99. padding-bottom: 30px;
  100. text-align: center;
  101. font-size: 18px;
  102. }
  103. .main {
  104. background: #fff;
  105. border-radius: {{ border_radius }}px;
  106. width: 100%;
  107. box-shadow: 0 -1px 0 #e0e0e0, 0 0 2px rgba(0,0,0,0.12), 0 2px 4px rgba(0,0,0,0.24); }
  108. .wrapper {
  109. box-sizing: border-box;
  110. padding: 50px; }
  111. .footer {
  112. clear: both;
  113. padding-top: 10px;
  114. text-align: center;
  115. width: 100%; }
  116. .footer td,
  117. .footer p,
  118. .footer span,
  119. .footer a {
  120. color: #999999;
  121. font-size: 12px;
  122. text-align: center; }
  123. .content-block {
  124. padding-top: 10px;
  125. }
  126. .content-block img {
  127. margin: 10px 0;
  128. }
  129. /* -------------------------------------
  130. TYPOGRAPHY
  131. ------------------------------------- */
  132. h1,
  133. h2,
  134. h3,
  135. h4 {
  136. color: #000000;
  137. font-family: sans-serif;
  138. font-weight: 400;
  139. line-height: 1.4;
  140. margin: 0;
  141. margin-bottom: 30px; }
  142. h1 {
  143. font-size: 35px;
  144. font-weight: 300;
  145. text-align: center;
  146. text-transform: capitalize; }
  147. p,
  148. ul,
  149. ol {
  150. font-family: sans-serif;
  151. font-size: 14px;
  152. font-weight: normal;
  153. margin: 0;
  154. margin-bottom: 15px; }
  155. p li,
  156. ul li,
  157. ol li {
  158. list-style-position: inside;
  159. margin-left: 5px; }
  160. ul {
  161. padding-left: 1em;
  162. }
  163. a {
  164. color: {{ primary }};
  165. font-weight: bold;
  166. text-decoration: none; }
  167. /* -------------------------------------
  168. BUTTONS
  169. ------------------------------------- */
  170. .btn {
  171. box-sizing: border-box;
  172. width: 100%; }
  173. .btn > tbody > tr > td {
  174. padding-bottom: 15px; }
  175. .btn table {
  176. width: auto; }
  177. .btn table td {
  178. background-color: #ffffff;
  179. border-radius: 5px;
  180. text-align: center; }
  181. .btn a {
  182. background-color: #ffffff;
  183. border: solid 1px #784288;
  184. border-radius: 5px;
  185. box-sizing: border-box;
  186. color: #784288;
  187. cursor: pointer;
  188. display: inline-block;
  189. font-size: 14px;
  190. font-weight: bold;
  191. margin: 0;
  192. padding: 12px 25px;
  193. text-decoration: none;
  194. text-transform: capitalize; }
  195. .btn-primary table td {
  196. background-color: #784288; }
  197. .btn-primary a {
  198. background-color: #784288;
  199. border-color: #784288;
  200. color: #ffffff; }
  201. /* -------------------------------------
  202. OTHER STYLES THAT MIGHT BE USEFUL
  203. ------------------------------------- */
  204. .last {
  205. margin-bottom: 0; }
  206. .first {
  207. margin-top: 0; }
  208. .align-center {
  209. text-align: center; }
  210. .align-right {
  211. text-align: right; }
  212. .align-left {
  213. text-align: left; }
  214. .clear {
  215. clear: both; }
  216. .mt0 {
  217. margin-top: 0; }
  218. .mb0 {
  219. margin-bottom: 0; }
  220. .preheader {
  221. color: transparent;
  222. display: none;
  223. height: 0;
  224. max-height: 0;
  225. max-width: 0;
  226. opacity: 0;
  227. overflow: hidden;
  228. mso-hide: all;
  229. visibility: hidden;
  230. width: 0; }
  231. .powered-by a {
  232. text-decoration: none; }
  233. hr {
  234. border: 0;
  235. border-bottom: 1px solid #f6f6f6;
  236. margin: 20px 0; }
  237. /* -------------------------------------
  238. RESPONSIVE AND MOBILE FRIENDLY STYLES
  239. ------------------------------------- */
  240. @media only screen and (max-width: 620px) {
  241. table[class=body] h1 {
  242. font-size: 28px !important;
  243. margin-bottom: 10px !important; }
  244. table[class=body] p,
  245. table[class=body] ul,
  246. table[class=body] ol,
  247. table[class=body] td,
  248. table[class=body] span,
  249. table[class=body] a {
  250. font-size: 16px !important; }
  251. table[class=body] .wrapper,
  252. table[class=body] .article {
  253. padding: 10px !important; }
  254. table[class=body] .content {
  255. padding: 0 !important; }
  256. table[class=body] .container {
  257. padding: 0 !important;
  258. width: 100% !important; }
  259. table[class=body] .main {
  260. border-left-width: 0 !important;
  261. border-radius: 0 !important;
  262. border-right-width: 0 !important; }
  263. table[class=body] .btn table {
  264. width: 100% !important; }
  265. table[class=body] .btn a {
  266. width: 100% !important; }
  267. table[class=body] .img-responsive {
  268. height: auto !important;
  269. max-width: 100% !important;
  270. width: auto !important; }}
  271. /* -------------------------------------
  272. PRESERVE THESE STYLES IN THE HEAD
  273. ------------------------------------- */
  274. @media all {
  275. .ExternalClass {
  276. width: 100%; }
  277. .ExternalClass,
  278. .ExternalClass p,
  279. .ExternalClass span,
  280. .ExternalClass font,
  281. .ExternalClass td,
  282. .ExternalClass div {
  283. line-height: 100%; }
  284. .apple-link a {
  285. color: inherit !important;
  286. font-family: inherit !important;
  287. font-size: inherit !important;
  288. font-weight: inherit !important;
  289. line-height: inherit !important;
  290. text-decoration: none !important; }
  291. .btn-primary table td:hover {
  292. background-color: #34495e !important; }
  293. .btn-primary a:hover {
  294. background-color: #34495e !important;
  295. border-color: #34495e !important; } }
  296. </style>
  297. </head>
  298. <body class="">
  299. <table border="0" cellpadding="0" cellspacing="0" class="body">
  300. <tr>
  301. <td>&nbsp;</td>
  302. <td class="container">
  303. <div class="content">
  304. <!-- START CENTERED WHITE CONTAINER -->
  305. <span class="preheader"></span>
  306. <div class="header">
  307. <img height="42" src="{{ logo }}" alt="Logo" />
  308. </div>
  309. <div class="postheader">
  310. {{ heading }}
  311. </div>
  312. <table class="main">
  313. <!-- START MAIN CONTENT AREA -->
  314. <tr>
  315. <td class="wrapper">
  316. <table border="0" cellpadding="0" cellspacing="0">
  317. <tr>
  318. <td>
  319. {{ body }}
  320. </td>
  321. </tr>
  322. </table>
  323. </td>
  324. </tr>
  325. <!-- END MAIN CONTENT AREA -->
  326. </table>
  327. <!-- START FOOTER -->
  328. <div class="footer">
  329. <table border="0" cellpadding="0" cellspacing="0">
  330. <tr>
  331. <td class="content-block">
  332. <img height="42" src="{{ logo }}" alt="Logo" />
  333. </td>
  334. </tr>
  335. <tr>
  336. <td class="content-block">
  337. <strong class="brand">Open Social</strong><br />
  338. <span class="tagline">"Make your people bloom"</span>
  339. </td>
  340. </tr>
  341. <tr>
  342. <td class="content-block powered-by">
  343. Copyright &copy; {{ "now"|date("Y") }}.
  344. </td>
  345. </tr>
  346. </table>
  347. </div>
  348. <!-- END FOOTER -->
  349. </div>
  350. </td>
  351. <td>&nbsp;</td>
  352. </tr>
  353. </table>
  354. </body>
  355. </html>