You are here

swiftmailer.html.twig in Open Social 8.6

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