I seem to be having some trouble with the token module on my site.

I'm running 7.x-1.6 on Drupal 7.39.

The following is a copy of an email forwarded to me by a customer after their purchase through Drupal COmmerce.

---BEGIN EMAIL---

An account was created for you after your order at I Liq Chuan.
You may now log in by clicking this link or copying and pasting it to your browser:
[user:one-time-login-url]
This link can only be used once to log in and will lead you to a page where you can set your password.
After setting your password, you will be able to log in at http://iliqchuan.com/user in the future using:
username: davezmail9@yahoo.com
password: Your password

---END EMAIL---

As you can see the one time log in token doesn't get replaced with the proper value and new users have to contact me for a log in. The help link for the token module /admin/help/token loads a white screen.

Not sure how to proceed, please advise.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

svn7svn created an issue. See original summary.

ManuelRS’s picture

Im with the same issue.
The url just send to user to the website and user isnt logged in.

mattgross’s picture

We're also having this issue. We have a client that needs to be able to send out password reset emails with custom verbiage, since staff members are the ones resetting passwords for members. The token [user:one-time-login-url] only appears to work within the Password Reset and New Account emails

Specifically we're working with the Login One-Time module for this functionality, and that email appears to be the one with the issue.

AstonVictor’s picture

Check this post.

Short version:

function mymodule_mail_alter(&$message){
  $account = user_load_by_mail($message['to']);
  $message['body'][0] = str_replace("[user:one-time-login-url]", $login_link, $message['body'][0]);
}
fjgarlin’s picture

Status: Active » Needs review
FileSize
533 bytes

As suggested here: https://www.drupal.org/project/commerce_email/issues/1864350#comment-965... (follow up to the previously linked comment), the following patch could be added to this module.

mradcliffe’s picture

I confirmed the patch in #5 works as expected manually testing both a custom email and the account recovery email to make sure that it didn't cause any regressions with core account emails.