You are here

mailgun--test-form-email.html.twig in Mailgun 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:

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

File

modules/mailgun_email_templates_examples/templates/mailgun--test-form-email.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. * - mailgun.html.twig: global, used by default.
  23. * - mailgun--mymodule.html.twig: only emails sent by the module "mymodule".
  24. * - mailgun--mymodule--test.html.twig: only emails by the module
  25. * "mymodule" with key "test".
  26. *
  27. * @see template_preprocess()
  28. * @see template_preprocess_mailgun()
  29. *
  30. * @ingroup themeable
  31. */
  32. #}
  33. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  34. <html xmlns="http://www.w3.org/1999/xhtml" style="font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif; box-sizing: border-box; font-size: 14px; margin: 0;">
  35. <head>
  36. <meta name="viewport" content="width=device-width" />
  37. <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
  38. <style type="text/css">
  39. img {
  40. max-width: 100%;
  41. }
  42. body {
  43. -webkit-font-smoothing: antialiased; -webkit-text-size-adjust: none; width: 100% !important; height: 100%; line-height: 1.6em;
  44. }
  45. body {
  46. background-color: #f6f6f6;
  47. }
  48. @media only screen and (max-width: 640px) {
  49. body {
  50. padding: 0 !important;
  51. }
  52. h1 {
  53. font-weight: 800 !important; margin: 20px 0 5px !important;
  54. }
  55. h2 {
  56. font-weight: 800 !important; margin: 20px 0 5px !important;
  57. }
  58. h3 {
  59. font-weight: 800 !important; margin: 20px 0 5px !important;
  60. }
  61. h4 {
  62. font-weight: 800 !important; margin: 20px 0 5px !important;
  63. }
  64. h1 {
  65. font-size: 22px !important;
  66. }
  67. h2 {
  68. font-size: 18px !important;
  69. }
  70. h3 {
  71. font-size: 16px !important;
  72. }
  73. .container {
  74. padding: 0 !important; width: 100% !important;
  75. }
  76. .content {
  77. padding: 0 !important;
  78. }
  79. .content-wrap {
  80. padding: 10px !important;
  81. }
  82. }
  83. </style>
  84. </head>
  85. <body itemscope itemtype="http://schema.org/EmailMessage" style="font-family: 'Helvetica Neue',Helvetica,Arial,sans-serif; box-sizing: border-box; font-size: 14px; -webkit-font-smoothing: antialiased; -webkit-text-size-adjust: none; width: 100% !important; height: 100%; line-height: 1.6em; background-color: #f6f6f6; margin: 0;" bgcolor="#f6f6f6">
  86. <table class="body-wrap" style="font-family: 'Helvetica Neue',Helvetica,Arial,sans-serif; box-sizing: border-box; font-size: 14px; width: 100%; background-color: #f6f6f6; margin: 0;" bgcolor="#f6f6f6"><tr style="font-family: 'Helvetica Neue',Helvetica,Arial,sans-serif; box-sizing: border-box; font-size: 14px; margin: 0;">
  87. <td style="font-family: 'Helvetica Neue',Helvetica,Arial,sans-serif; box-sizing: border-box; font-size: 14px; vertical-align: top; margin: 0;" valign="top"></td>
  88. <td class="container" width="600" style="font-family: 'Helvetica Neue',Helvetica,Arial,sans-serif; box-sizing: border-box; font-size: 14px; vertical-align: top; display: block !important; max-width: 600px !important; clear: both !important; margin: 0 auto;" valign="top">
  89. <div class="content" style="font-family: 'Helvetica Neue',Helvetica,Arial,sans-serif; box-sizing: border-box; font-size: 14px; max-width: 600px; display: block; margin: 0 auto; padding: 20px;">
  90. <table class="main" width="100%" cellpadding="0" cellspacing="0" style="font-family: 'Helvetica Neue',Helvetica,Arial,sans-serif; box-sizing: border-box; font-size: 14px; border-radius: 3px; background-color: #fff; margin: 0; border: 1px solid #e9e9e9;" bgcolor="#fff">
  91. <tr style="font-family: 'Helvetica Neue',Helvetica,Arial,sans-serif; box-sizing: border-box; font-size: 14px; margin: 0;">
  92. <td class="alert alert-warning" style="font-family: 'Helvetica Neue',Helvetica,Arial,sans-serif; box-sizing: border-box; font-size: 16px; vertical-align: top; color: #fff; font-weight: 500; text-align: center; border-radius: 3px 3px 0 0; background-color: #17c623; margin: 0; padding: 20px;" align="center" bgcolor="#FF9F00" valign="top">
  93. {{ 'Success: You received an email from Mailgun!'|t }}
  94. </td>
  95. </tr>
  96. <tr style="font-family: 'Helvetica Neue',Helvetica,Arial,sans-serif; box-sizing: border-box; font-size: 14px; margin: 0;"><td class="content-wrap" style="font-family: 'Helvetica Neue',Helvetica,Arial,sans-serif; box-sizing: border-box; font-size: 14px; vertical-align: top; margin: 0; padding: 20px;" valign="top">
  97. <table width="100%" cellpadding="0" cellspacing="0" style="font-family: 'Helvetica Neue',Helvetica,Arial,sans-serif; box-sizing: border-box; font-size: 14px; margin: 0;">
  98. <tr style="font-family: 'Helvetica Neue',Helvetica,Arial,sans-serif; box-sizing: border-box; font-size: 14px; margin: 0;">
  99. <td class="content-block" style="font-family: 'Helvetica Neue',Helvetica,Arial,sans-serif; box-sizing: border-box; font-size: 14px; vertical-align: top; margin: 0; padding: 0 0 20px;" valign="top">
  100. {{ body }}
  101. </td>
  102. </tr>
  103. </table>
  104. </td>
  105. </tr>
  106. </table>
  107. <div class="footer" style="font-family: 'Helvetica Neue',Helvetica,Arial,sans-serif; box-sizing: border-box; font-size: 14px; width: 100%; clear: both; color: #999; margin: 0; padding: 20px;">
  108. <table width="100%" style="font-family: 'Helvetica Neue',Helvetica,Arial,sans-serif; box-sizing: border-box; font-size: 14px; margin: 0;">
  109. <tr style="font-family: 'Helvetica Neue',Helvetica,Arial,sans-serif; box-sizing: border-box; font-size: 14px; margin: 0;">
  110. <td class="aligncenter content-block" style="font-family: 'Helvetica Neue',Helvetica,Arial,sans-serif; box-sizing: border-box; font-size: 12px; vertical-align: top; color: #999; text-align: center; margin: 0; padding: 0 0 20px;" align="center" valign="top">
  111. {{ 'Thanks for using'|t }} <a href="https://www.drupal.org/project/mailgun" style="font-family: 'Helvetica Neue',Helvetica,Arial,sans-serif; box-sizing: border-box; font-size: 12px; color: #999; text-decoration: underline; margin: 0;">{{ 'Mailgun' }}</a>.
  112. </td>
  113. </tr>
  114. </table>
  115. </div>
  116. </div>
  117. </td>
  118. <td style="font-family: 'Helvetica Neue',Helvetica,Arial,sans-serif; box-sizing: border-box; font-size: 14px; vertical-align: top; margin: 0;" valign="top"></td>
  119. </tr></table></body>
  120. </html>