You are here

htmlmail--user--password_reset.html.twig in HTML Mail 8.3

Same filename and directory in other branches
  1. 8 templates/htmlmail--user--password_reset.html.twig

Sample template for sending user password reset messages with HTML Mail.

The following variables are available in this template:

  • $message_id: The email message id, which is 'user_password_reset'
  • $module: The sending module, which is 'user'.
  • $key: The user email action, which is 'password_reset'.
  • $headers: An array of email (name => value) pairs.
  • $from: The configured sender address.
  • $to: The recipient email address.
  • $subject: The message subject line.
  • $body: The formatted message body.
  • $language: The language code for this message.
  • $params: An array containing the following keys:
    • account: The user object whose password is being requested, which contains the following useful properties:

      • uid: The user-id number.
      • name: The user login name.
      • mail: The user email address. Should be the same as $to.
      • theme: The user-chosen theme, or a blank string if unset.
      • signature: The user signature block.
      • signature_format: The text input filter used to format the signature.
      • created: Account creation date, as a unix timestamp.
      • access: Account access date, as a unix timestamp.
      • login: Account login date, as a unix timestamp.
      • status: Integer 0 = disabled; 1 = enabled.
      • timezone: User timezone, or NULL if unset.
      • language: User language, or blank string if unset.
      • picture: Path to user picture, or blank string if unset.
      • init: The email address used to initially register this account.
      • data: User profile data, as a serialized string.
      • roles: Array of roles assigned to this user, as (rid => role_name) pairs.
  • $template_path: The relative path to the template directory.
  • $template_url: The absolute url to the template directory.
  • $theme: The name of the selected Email theme.
  • $theme_path: The relative path to the Email theme directory.
  • $theme_url: The absolute url to the Email theme directory.

File

templates/htmlmail--user--password_reset.html.twig
View source
  1. {#
  2. /**
  3. * @file
  4. * Sample template for sending user password reset messages with HTML Mail.
  5. *
  6. * The following variables are available in this template:
  7. *
  8. * - $message_id: The email message id, which is 'user_password_reset'
  9. * - $module: The sending module, which is 'user'.
  10. * - $key: The user email action, which is 'password_reset'.
  11. * - $headers: An array of email (name => value) pairs.
  12. * - $from: The configured sender address.
  13. * - $to: The recipient email address.
  14. * - $subject: The message subject line.
  15. * - $body: The formatted message body.
  16. * - $language: The language code for this message.
  17. * - $params: An array containing the following keys:
  18. * - account: The user object whose password is being requested, which
  19. * contains the following useful properties:
  20. * - uid: The user-id number.
  21. * - name: The user login name.
  22. * - mail: The user email address. Should be the same as $to.
  23. * - theme: The user-chosen theme, or a blank string if unset.
  24. * - signature: The user signature block.
  25. * - signature_format: The text input filter used to format the signature.
  26. * - created: Account creation date, as a unix timestamp.
  27. * - access: Account access date, as a unix timestamp.
  28. * - login: Account login date, as a unix timestamp.
  29. * - status: Integer 0 = disabled; 1 = enabled.
  30. * - timezone: User timezone, or NULL if unset.
  31. * - language: User language, or blank string if unset.
  32. * - picture: Path to user picture, or blank string if unset.
  33. * - init: The email address used to initially register this account.
  34. * - data: User profile data, as a serialized string.
  35. * - roles: Array of roles assigned to this user, as (rid => role_name)
  36. * pairs.
  37. * - $template_path: The relative path to the template directory.
  38. * - $template_url: The absolute url to the template directory.
  39. * - $theme: The name of the selected Email theme.
  40. * - $theme_path: The relative path to the Email theme directory.
  41. * - $theme_url: The absolute url to the Email theme directory.
  42. */
  43. #}
  44. <div class="htmlmail-user-password-reset-body htmlmail-user-body htmlmail-body">
  45. {{ message.body }}
  46. </div>
  47. {% if debug %}
  48. <hr />
  49. <div class="htmlmail-user-password-reset-debug htmlmail-user-debug htmlmail-debug">
  50. <dl>
  51. <dt>
  52. <p>To customize your user password reset messages:</p>
  53. </dt>
  54. <dd>
  55. <ol>
  56. {% if not theme %}
  57. <li>
  58. <p>
  59. Visit <u>admin/config/system/htmlmail</u>
  60. and select a theme to hold your custom email template files.
  61. </p>
  62. </li>
  63. {% elseif not theme_path %}
  64. <li>
  65. <p>
  66. <?php elseif (empty($theme_path)): ?>
  67. Visit <u>admin/build/themes</u>
  68. to enable your selected <u>{{ theme|capitalize }}</u> theme.
  69. </p>
  70. </li>
  71. {% endif %}
  72. {% set themeTemplate = "%s/%s"|format(theme_path, message_template) %}
  73. {% if _self.getTemplateName() == themeTemplate %}
  74. <li>
  75. <p>
  76. Edit your<br />
  77. <u><code>{{ _self.getTemplateName() }}</code></u>
  78. <br />file.
  79. </p>
  80. </li>
  81. {% else %}
  82. {% if not theme_html_exists %}
  83. <li>
  84. <p>
  85. Copy<br />
  86. <u><code>{{ module_path }}/htmlmail.html.twig</code></u>
  87. <br />to<br />
  88. <u><code>{{ theme_path }}/htmlmail.html.twig</code></u>
  89. </p>
  90. </li>
  91. {% endif %}
  92. {% if not module_template_exists %}
  93. <li>
  94. <p>
  95. For general user-module message customization, copy<br />
  96. <u><code>{{ module_path }}//htmlmail.html.twig</code></u>
  97. <br />to<br />
  98. <code>{{ theme_path }}/{{ module_template }}</code>
  99. </p>
  100. </li>
  101. {% endif %}
  102. {% if not message_template_exists %}
  103. <li>
  104. <p>
  105. Copy<br />
  106. <u><code>{{ module_path }}//htmlmail.html.twig</code></u>
  107. <br />to<br />
  108. <u><code>{{ theme_path }}/{{ message_template }}</code></u>.
  109. </p>
  110. </li>
  111. {% endif %}
  112. <li>
  113. <p>Edit the copied file.</p>
  114. </li>
  115. {% endif %}
  116. <li>
  117. <p>Send a test message to make sure your customizations worked.</p>
  118. </li>
  119. <li>
  120. <p>
  121. If you think your customizations would be of use to others,
  122. please contribute your file as a feature request in the
  123. <a href="https://www.drupal.org/node/add/project-issue/htmlmail">issue queue</a>.
  124. </p>
  125. </li>
  126. </ol>
  127. </dd>
  128. <dt>
  129. <p>
  130. The user module sets the <u><code>$params</code></u> variable.
  131. For this message,
  132. </p>
  133. </dt>
  134. <dd>
  135. <p>
  136. <code><pre>
  137. $params = {{ pre_formatted_params }}
  138. </pre></code>
  139. </p>
  140. </dd>
  141. </dl>
  142. </div>
  143. {% endif %}