How to send one time login url with Rules? I have a rule to create a user and an action to send login url to user's email. I didn't find any action to send login url, so added an Send HTML Email action and added the [user-created:one-time-login-url] token in mail body. but it appears as it is([user-created:one-time-login-url]), and is not translated to login url. 

Then I used this php function to print the same url:

&lt;?php
print user_pass_reset_url($user_created); 
?&gt;


It prints a url but also prints the following notices:

Notice: Undefined property: stdClass::$uid in user_pass_reset_url() (in line 2299 /var/www/web/modules/user/user.module).
Notice: Undefined property: stdClass::$pass in user_pass_reset_url() (in line 2299 /var/www/web/modules/user/user.module).
Notice: Undefined property: stdClass::$login in user_pass_reset_url() (in line 2299 /var/www/web/modules/user/user.module).


$user_created is the php variable referring to the user created in the previous action. But it seems it's not a user object(because of notices).

What's the proper way to send one time login url?
Try out Login one time module


  The use case for this is where your users can't figure out how to use
  a username and password - so they request an email link to what they
  need.