htmlmail--user--password_reset.tpl.php 4.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112
  1. <?php
  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 object 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. $template_name = basename(__FILE__);
  44. $current_path = realpath(NULL);
  45. $current_len = strlen($current_path);
  46. $template_path = realpath(dirname(__FILE__));
  47. if (!strncmp($template_path, $current_path, $current_len)) {
  48. $template_path = substr($template_path, $current_len + 1);
  49. }
  50. $template_url = url($template_path, array('absolute' => TRUE));
  51. ?>
  52. <div class="htmlmail-user-password-reset-body htmlmail-user-body htmlmail-body">
  53. <?php echo $body; ?>
  54. </div>
  55. <?php if ($debug):
  56. $module_template = "htmlmail--user.tpl.php";
  57. $message_template = 'htmlmail--user--password_reset.tpl.php';
  58. ?>
  59. <hr />
  60. <div class="htmlmail-user-password-reset-debug htmlmail-user-debug htmlmail-debug">
  61. <dl><dt><p>
  62. To customize your user password reset messages:
  63. </p></dt><dd><ol><li><p><?php if (empty($theme)): ?>
  64. Visit <u>admin/config/system/htmlmail</u>
  65. and select a theme to hold your custom email template files.
  66. </p></li><li><p><?php elseif (empty($theme_path)): ?>
  67. Visit <u>admin/build/themes</u>
  68. to enable your selected <u><?php echo drupal_ucfirst($theme); ?></u> theme.
  69. </p></li><li><?php endif;
  70. if ("$template_path/$template_name" == "$theme_path/$message_template"): ?><p>
  71. Edit your<br />
  72. <u><code><?php echo "$template_path/$template_name"; ?></code></u>
  73. <br />file.
  74. </p></li><li><?php
  75. else:
  76. if (!file_exists("$theme_path/htmlmail.tpl.php")): ?><p>
  77. Copy<br />
  78. <u><code><?php echo "$module_path/htmlmail.tpl.php"; ?></code></u>
  79. <br />to<br />
  80. <u><code><?php echo "$theme_path/htmlmail.tpl.php"; ?></code></u>
  81. </p></li><li><?php
  82. endif;
  83. if (!file_exists("$theme_path/$module_template")): ?><p>
  84. For general user-module message customization, copy<br />
  85. <u><code><?php echo "$module_path/htmlmail.tpl.php"; ?></code></u>
  86. <br />to<br />
  87. <code><?php echo "$theme_path/$module_template"; ?></code>
  88. </p></li><li><?php
  89. endif;
  90. if (!file_exists("$theme_path/$message_template")): ?><p>
  91. Copy<br />
  92. <u><code><?php echo "$template_path/$template_name"; ?></code></u>
  93. <br />to<br />
  94. <u><code><?php echo "$theme_path/$message_template"; ?></code></u>.
  95. </p></li><li><?php endif; ?><p>
  96. Edit the copied file.
  97. </p></li><li><?php
  98. endif; ?><p>
  99. Send a test message to make sure your customizations worked.
  100. </p></li><li><p>
  101. If you think your customizations would be of use to others,
  102. please contribute your file as a feature request in the
  103. <a href="http://drupal.org/node/add/project-issue/htmlmail">issue queue</a>.
  104. </p></li></ol></dd><dt><p>
  105. The user module sets the <u><code>$params</code></u> variable.
  106. For this message,
  107. </p></dt><dd><p><code><pre>
  108. $params = <?php echo check_plain(print_r($params, 1)); ?>
  109. </pre></code></p></dd></dl>
  110. </div>
  111. <?php endif;