-1

Some (only a few) of my users do not receive the "one time login url" mail when they want to reset their (forgotten) password (also checked in spam and trash).

The odd thing is that if I personnaly send them a mail from postmaster@... (using thunderbird for instance), they receive it. I find no explanation to that.

So, I envisage to personnaly send them their [user:one-time-login-url]. Can I do that ? How ?

0

In the user module function user_pass_reset_url($account) is used to generate one time login url. if you know the uid of the user you can load that user object and pass it as the $account for that function and send the generated link in your custom email.

  • I am not a smart programmer ; I can find the user Id (no pb with that) ; but then, how can I call this function, ... and get the answer (to capy-paste it) ? – Jacques-Marie Moranne Oct 27 '17 at 16:00
  • As an alternative, I have seen that one-time-login.module generates a csv file which contains the URL : is this csv stored somewhere (where it can be consulted) ? As an other alternative, would it be possible that the administrator be in copy of the mail sent to the user ? – Jacques-Marie Moranne Oct 27 '17 at 16:05
  • Im not sure about the one-time-login.module as I have not used that module personally. But if you have your own custom module, you can use the code in my answer. Just call the function user_pass_reset_url($account) and pass the user object as $account you should have your url and if you also have a look at hook_mail. Im sure you can cc the users with administrator roles while sending mail. – Sanjok Gurung Oct 30 '17 at 10:20
  • Thank you Sanjok : I tried to develop a small php which calls user_pass_reset_url($account) function, as you suggest, but got some errors that I am not skilly enough to overpass (e.g. : Fatal error: Class 'DrupalDefaultEntityController' not found in /home/bapaparoisse/www/www/modules/user/user.module on line 300). I was suggested to use drush uli USERNAME which seems to work (I tested it successfully). Thanks again for your answer. – Jacques-Marie Moranne Oct 31 '17 at 11:36

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.