You are here

mailgun.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

templates/mailgun.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. <html>
  34. <head>
  35. <style type="text/css">
  36. table tr td {
  37. font-family: Arial;
  38. font-size: 12px;
  39. }
  40. </style>
  41. </head>
  42. <body>
  43. <div>
  44. <table width="800px" cellpadding="0" cellspacing="0">
  45. <tr>
  46. <td>
  47. <div style="padding: 0px 0px 0px 0px;">
  48. {{ body }}
  49. </div>
  50. </td>
  51. </tr>
  52. </table>
  53. </div>
  54. </body>
  55. </html>