You are here

swiftmailer.html.twig in Open Social 8.9

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/email/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. color: #4a4a4a;
  50. font-family: sans-serif;
  51. -webkit-font-smoothing: antialiased;
  52. font-size: 14px;
  53. line-height: 1.4;
  54. margin: 0;
  55. padding: 0;
  56. -ms-text-size-adjust: 100%;
  57. -webkit-text-size-adjust: 100%; }
  58. table {
  59. border-collapse: separate;
  60. mso-table-lspace: 0pt;
  61. mso-table-rspace: 0pt;
  62. width: 100%; }
  63. table td {
  64. font-family: sans-serif;
  65. font-size: 14px;
  66. vertical-align: top; }
  67. /* -------------------------------------
  68. BODY & CONTAINER
  69. ------------------------------------- */
  70. .body {
  71. background-color: #f6f6f6;
  72. width: 100%; }
  73. /* 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 */
  74. .container {
  75. display: block;
  76. margin: 0 auto !important;
  77. /* makes it centered */
  78. max-width: 580px;
  79. padding: 10px;
  80. width: 580px; }
  81. /* This should also be a block element, so that it will fill 100% of the .container */
  82. .content {
  83. box-sizing: border-box;
  84. display: block;
  85. margin: 0 auto;
  86. max-width: 580px;
  87. padding: 10px; }
  88. /* -------------------------------------
  89. HEADER, FOOTER, MAIN
  90. ------------------------------------- */
  91. .header {
  92. padding-top: 30px;
  93. padding-bottom: 30px;
  94. text-align: center;
  95. }
  96. .postheader {
  97. padding-bottom: 30px;
  98. text-align: center;
  99. font-size: 18px;
  100. }
  101. .main {
  102. background: #fff;
  103. width: 100%;
  104. box-shadow: 0 -1px 0 #e0e0e0, 0 0 2px rgba(0,0,0,0.12), 0 2px 4px rgba(0,0,0,0.24); }
  105. .wrapper {
  106. box-sizing: border-box;
  107. padding: 50px 35px 15px; }
  108. .footer {
  109. clear: both;
  110. padding-top: 10px;
  111. text-align: center;
  112. width: 100%; }
  113. .footer td,
  114. .footer p,
  115. .footer span,
  116. .footer a {
  117. color: #999999;
  118. font-size: 12px;
  119. text-align: center; }
  120. .content-block {
  121. padding-top: 10px;
  122. }
  123. .content-block img {
  124. margin: 10px 0;
  125. }
  126. /* -------------------------------------
  127. TYPOGRAPHY
  128. ------------------------------------- */
  129. h1,
  130. h2,
  131. h3,
  132. h4 {
  133. color: #000000;
  134. font-family: sans-serif;
  135. font-weight: 400;
  136. line-height: 1.4;
  137. margin: 0;
  138. margin-bottom: 30px; }
  139. h1 {
  140. font-size: 35px;
  141. font-weight: 300;
  142. text-align: center;
  143. text-transform: capitalize; }
  144. p,
  145. ul,
  146. ol {
  147. font-family: sans-serif;
  148. font-size: 14px;
  149. font-weight: normal;
  150. margin: 0;
  151. margin-bottom: 15px; }
  152. p li,
  153. ul li,
  154. ol li {
  155. list-style-position: inside;
  156. margin-left: 5px; }
  157. ul {
  158. padding-left: 1em;
  159. }
  160. a {
  161. color: {{ primary }};
  162. text-decoration: none;
  163. font-weight: 700; }
  164. .first-paragraph {
  165. font-size: 16px;
  166. margin-bottom: 20px; }
  167. .bottom-space {
  168. margin-bottom: 40px; }
  169. .notification {
  170. font-size: 18px;
  171. margin-bottom: 20px; }
  172. /* -------------------------------------
  173. BUTTONS
  174. ------------------------------------- */
  175. .btn {
  176. box-sizing: border-box;
  177. width: 100%; }
  178. .btn > tbody > tr > td {
  179. padding-bottom: 15px; }
  180. .btn table {
  181. width: auto; }
  182. .btn table td {
  183. background-color: #ffffff;
  184. border-radius: 5px;
  185. text-align: center; }
  186. .btn a {
  187. background-color: #ffffff;
  188. border: solid 1px #784288;
  189. border-radius: 5px;
  190. box-sizing: border-box;
  191. color: #784288;
  192. cursor: pointer;
  193. display: inline-block;
  194. font-size: 14px;
  195. font-weight: bold;
  196. margin: 0;
  197. padding: 12px 25px;
  198. text-decoration: none;
  199. text-transform: capitalize; }
  200. .btn-primary table td {
  201. background-color: #784288; }
  202. .btn-primary a {
  203. background-color: #784288;
  204. border-color: #784288;
  205. color: #ffffff; }
  206. .btn-wrapp {
  207. margin-bottom: 30px; }
  208. .btn-wrapp td {
  209. padding: 0 10px; }
  210. .btn-wrapp td:nth-child(odd) {
  211. padding-left: 0; }
  212. .btn-wrapp td:nth-child(even) {
  213. padding-right: 0; }
  214. .btn-link {
  215. display: block;
  216. position: relative;
  217. margin-bottom: 15px;
  218. border-radius: 5px;
  219. border: 1px solid {{ primary }};
  220. color: {{ primary }};
  221. padding: 9px 25px 7px;
  222. text-align: center; }
  223. .btn-link-one {
  224. display: inline-block;
  225. min-width: 230px; }
  226. .btn-link img {
  227. position: absolute;
  228. top: 10px;
  229. left: 11px; }
  230. .btn-link-bg {
  231. background-color: {{ primary }};
  232. color: #ffffff; }
  233. /* -------------------------------------
  234. COMMENTS, POST, MESSAGE STYLES
  235. ------------------------------------- */
  236. .comments {
  237. padding: 5px 0 0;
  238. border-radius: 5px;
  239. border: 2px solid #e0e0e0;
  240. margin-bottom: 20px; }
  241. .comment {
  242. padding: 15px 20px 0;
  243. border-radius: 5px; }
  244. .reply {
  245. padding-bottom: 20px;
  246. margin: 20px 15px;
  247. background: #f3f3f3; }
  248. .post {
  249. padding: 15px 20px 20px; }
  250. .message {
  251. padding: 5px 20px; }
  252. .author-msg {
  253. margin-bottom: 10px; }
  254. .post p,
  255. .comment p {
  256. margin: 10px 0; }
  257. .post-answer {
  258. background-color: #f3f3f3; }
  259. .middle-block {
  260. padding: 45px 0 0;
  261. margin-bottom: 30px;
  262. border-bottom: 2px solid #e0e0e0;
  263. border-top: 2px solid #e0e0e0; }
  264. /* -------------------------------------
  265. OTHER STYLES THAT MIGHT BE USEFUL
  266. ------------------------------------- */
  267. .last {
  268. margin-bottom: 0; }
  269. .first {
  270. margin-top: 0; }
  271. .align-center {
  272. text-align: center; }
  273. .align-right {
  274. text-align: right; }
  275. .align-left {
  276. text-align: left; }
  277. .clear {
  278. clear: both; }
  279. .mt0 {
  280. margin-top: 0; }
  281. .mb0 {
  282. margin-bottom: 0; }
  283. .logo {
  284. max-height: 80px;
  285. max-width: 160px; }
  286. .preheader {
  287. color: transparent;
  288. display: none;
  289. height: 0;
  290. max-height: 0;
  291. max-width: 0;
  292. opacity: 0;
  293. overflow: hidden;
  294. mso-hide: all;
  295. visibility: hidden;
  296. width: 0; }
  297. .powered-by a {
  298. text-decoration: none; }
  299. hr {
  300. border: 0;
  301. border-bottom: 1px solid #f6f6f6;
  302. margin: 20px 0; }
  303. /* -------------------------------------
  304. RESPONSIVE AND MOBILE FRIENDLY STYLES
  305. ------------------------------------- */
  306. @media only screen and (max-width: 620px) {
  307. table[class=body] h1 {
  308. font-size: 28px !important;
  309. margin-bottom: 10px !important; }
  310. table[class=body] p,
  311. table[class=body] ul,
  312. table[class=body] ol,
  313. table[class=body] td,
  314. table[class=body] span,
  315. table[class=body] a {
  316. font-size: 16px !important; }
  317. table[class=body] .wrapper,
  318. table[class=body] .article {
  319. padding: 10px !important; }
  320. table[class=body] .content {
  321. padding: 0 !important; }
  322. table[class=body] .container {
  323. padding: 0 !important;
  324. width: 100% !important; }
  325. table[class=body] .main {
  326. border-left-width: 0 !important;
  327. border-radius: 0 !important;
  328. border-right-width: 0 !important; }
  329. table[class=body] .btn table {
  330. width: 100% !important; }
  331. table[class=body] .btn a {
  332. width: 100% !important; }
  333. table[class=body] .img-responsive {
  334. height: auto !important;
  335. max-width: 100% !important;
  336. width: auto !important; }}
  337. /* -------------------------------------
  338. PRESERVE THESE STYLES IN THE HEAD
  339. ------------------------------------- */
  340. @media all {
  341. .ExternalClass {
  342. width: 100%; }
  343. .ExternalClass,
  344. .ExternalClass p,
  345. .ExternalClass span,
  346. .ExternalClass font,
  347. .ExternalClass td,
  348. .ExternalClass div {
  349. line-height: 100%; }
  350. .apple-link a {
  351. color: inherit !important;
  352. font-family: inherit !important;
  353. font-size: inherit !important;
  354. font-weight: inherit !important;
  355. line-height: inherit !important;
  356. text-decoration: none !important; }
  357. .btn-primary table td:hover {
  358. background-color: #34495e !important; }
  359. .btn-primary a:hover {
  360. background-color: #34495e !important;
  361. border-color: #34495e !important; } }
  362. </style>
  363. </head>
  364. <body class="">
  365. <table border="0" cellpadding="0" cellspacing="0" class="body">
  366. <tr>
  367. <td>&nbsp;</td>
  368. <td class="container">
  369. <div class="content">
  370. <!-- START CENTERED WHITE CONTAINER -->
  371. <span class="preheader"></span>
  372. <div class="header">
  373. <img src="{{ logo }}" alt="Logo" class="logo" />
  374. </div>
  375. <div class="postheader">
  376. {{ heading }}
  377. </div>
  378. <table class="main">
  379. <!-- START MAIN CONTENT AREA -->
  380. <tr>
  381. <td class="wrapper">
  382. <table border="0" cellpadding="0" cellspacing="0">
  383. {% if header %}
  384. <tr>
  385. <td>
  386. {{ header }}
  387. </td>
  388. </tr>
  389. {% endif %}
  390. <tr>
  391. <td>
  392. {{ body }}
  393. </td>
  394. </tr>
  395. {% if footer %}
  396. <tr>
  397. <td>
  398. {{ footer }}
  399. </td>
  400. </tr>
  401. {% endif %}
  402. </table>
  403. </td>
  404. </tr>
  405. <!-- END MAIN CONTENT AREA -->
  406. </table>
  407. <!-- START FOOTER -->
  408. <div class="footer">
  409. <table border="0" cellpadding="0" cellspacing="0">
  410. <tr>
  411. <td class="content-block">
  412. <strong class="brand">
  413. {% if site_link %}
  414. <a href="{{ base_url }}">{{ site_name }}</a>
  415. {% else %}
  416. {{ site_name }}
  417. {% endif %}
  418. </strong>
  419. {% if site_slogan %}
  420. <br />
  421. <span class="tagline">{{ site_slogan }}</span>
  422. {% endif %}
  423. </td>
  424. </tr>
  425. <tr>
  426. <td class="content-block powered-by">
  427. Copyright &copy; {{ "now"|date("Y") }}.
  428. </td>
  429. </tr>
  430. </table>
  431. </div>
  432. <!-- END FOOTER -->
  433. </div>
  434. </td>
  435. <td>&nbsp;</td>
  436. </tr>
  437. </table>
  438. </body>
  439. </html>