On the admin page it has the following form entry:

  $form['mail']['account_reminder_msg'] = array(
    '#type' => 'textarea',
    '#title' => t('Email body'),
    '#default_value' => variable_get('account_reminder_msg', '!username,

This is a reminder from !site. You have registered for a user account but have not yet validated your email address. To fully activate your account at !login_uri login use the following username and password:

username: !username
password: !password

You may also log in by clicking on this link or copying and pasting it in your browser:

!login_url

This is a one-time login, so it can be used only once.


--  !site team

You can stop receiving these reminder emails by either activating your account, or using the unsubscribe link below:

!unsubscribe_url'
    ),
    '#description' => t('Customise the body of the email. Valid variables are !site, !username, !login_uri, !login_url (the one time login link), !unsubscribe_url (A URL allowing users to opt out of recieving the reminder emails) and !password.'),
  );

but the mail hook has:

/**
 * Implementation of hook_mail().
 */
function account_reminder_mail($key, &$message, $params) {
  $variables = array(
    '%site' => variable_get('site_name', ''),
    '%username' => $params['user']->name,
    '%password' => $params['context']['pass'],
    '%login_uri' => $params['context']['login_uri'],
    '%login_url' => $params['context']['login_url'],
    '%unsubscribe_url' => $params['context']['unsubscribe_url'],
  );

note the % instead of !

This means that the module works fine until you amend the message as the default message in the mail handler has % but once you save settings it is overwritten with the version using ! and so variables are no longer converted to the correct string.

I suggest that it is changed in the hook to ! from % as the ! is used in core mail variables.

Comments

jaydub’s picture

This is the code in the current version in CVS:

http://cvs.drupal.org/viewvc.py/drupal/contributions/modules/account_rem...

There are no ! placeholders in there now so not sure what
you are seeing...Do you have an old development version?

As for the use of % over ! as placeholders, I've kept them
as % for now because users of the previous drupal 5 version
of the module already had % placeholders in there versions
and on upgrade it caused confusion with the change in placeholders
so I reverted back to %. In the future I could update any settings
in an update but didn't have time.

silid’s picture

I actually have the current development snapshot. 1.7.2.5 2008/04/22 is the version of the module file, and my first post still stands in relation to that version.

I take your point about the % placeholder for continuity with previous versions, so either the form needs correcting or the hook_mail could be updated to use both placeholders like so:

/**
* Implementation of hook_mail().
*/
function account_reminder_mail($key, &$message, $params) {
  $variables = array(
    '%site' => variable_get('site_name', ''),
    '%username' => $params['user']->name,
    '%password' => $params['context']['pass'],
    '%login_uri' => $params['context']['login_uri'],
    '%login_url' => $params['context']['login_url'],
    '%unsubscribe_url' => $params['context']['unsubscribe_url'],
    '!site' => variable_get('site_name', ''),
    '!username' => $params['user']->name,
    '!password' => $params['context']['pass'],
    '!login_uri' => $params['context']['login_uri'],
    '!login_url' => $params['context']['login_url'],
    '!unsubscribe_url' => $params['context']['unsubscribe_url'],
  );

Thanks,

Si

jaydub’s picture

Status: Active » Fixed
Anonymous’s picture

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for two weeks with no activity.