Mark Lyons
Mark Lyons

Reputation: 1422

Drupal email variables not appearing

Whenever a user registers an account, the automated emails (which I can set in admin/config/people/accounts) are not carrying over the defined variables for username, email, etc.

For example. Here's what I have set for one email:

[user:name],

Thank you for registering at [site:name]. Your application for an account is currently pending approval. Once it has been approved, you will receive another e-mail containing information about how to log in, set your password, and other details.

-- [site:name] team

Those variables in brackets just aren't appearing. The email sends as usual, but where those variables are, nothing gets inserted. Is there something I have to enable first?

Upvotes: 9

Views: 589

Answers (3)

anoopjohn
anoopjohn

Reputation: 518

The token replacement in mails happen in line 2815 of user.module (modules/user/user.module). You can add the following line of code

drupal_set_message("Text: $text, Variables: " . print_r($variables, TRUE) . ", Language: $language);

before the line that says

return token_replace($text, $variables, array('language' => $language, 'callback' => 'user_mail_tokens', 'sanitize' => FALSE, 'clear' => TRUE));

That will tell you as messages what is happening with the token replacement issue. If you can post the messages that you see back here I can help solve the issue.

Upvotes: 1

Shivanshu
Shivanshu

Reputation: 1269

-- READ FROM PHP.NET SPECIFICATIONS --,

  • I THINK THAT BY DEFAULT, SOME HOST PROVIDERS DO NOT SUPPORT FEW PHP FILTERS (OR LIKEWISE), SO (ITS JUST AN ASSUMPTION !) MAY BE, FILTER_SANITIZE_EMAIL THAT IS USED TO REMOVE ALL CHARACTERS EXCEPT LETTERS, DIGITS AND !#$%&'*+-/=?^_`{|}~@.[], IS TURNED ON. SO JUST CHECK IT OUT !

Upvotes: 0

Abadis
Abadis

Reputation: 2821

It seems that you have misconfiguration issues or losing sth .for seeing configs with html mail in here , see here also try updating it using update.php!

Upvotes: 0

Related Questions