Hello,
I am using LoginToboggan and would like to trigger a Rule based on account validation. Would someone in the community be able to help make this Rules Event "User has validated their account (LoginToboggan)"?
I found a post where the maintainer said "you can look for the object property $account->logintoboggan_email_validated = TRUE in the the $account object during the 'update' op of hook_user() to determine if the account has just been validated by LT"
Flow I want to achieve:
1) User clicks validation link in the email (LoginToboggan)
2) Event triggers a Rule (this project)
3) Rule has Action: Send privatemsg To: "User who validated" From: "Admin"
Please let me know if more information is needed.
Thank you!
Comments
you can create it using existing events
Hi trupal218,
I recently did a similar task with rules module(drupal6 version). Here is how I created the rule:
1. Use event "User account details have been updated".
2. create a condition "custom php code" to check whether current url is in the form of "user/validate".
3. create a condition "custom php code" to check that acting user is the one who's account is being validated.
4. create a condition "custom php code" to check if there was an transition from false to true in "logintoboggan_email_validated" property of user account object.
Now I attached a suitable action to the rule.
The exported rule (without action) is:
Cheers!!
wow! thanks so much
wow! thanks so much skporwal
gotta love the drupal community! =)
I imported the rule and
I imported the rule and tested it with rule debug on, but it seems like "User account details have been updated" is not triggered when a user clicks the validation link and is logged into their account. I am going to continue to troubleshoot and will post back if I can figure it out. Any pointers from the community will be appreciated! =)
Sorry for late reply. I just
Sorry for late reply. I just noticed the rules event "User account is updated" fires on "after_update" action and not on "update" action, so the exported rule won't work. Sincere apologies for the initial wrong solution.
For this, as rightly stated by last commenter , a small module will suffice which create an rules event and fires it on 'update' operation of hook_user.
you can download a working module which does this from here http://logintoboggan-rules.googlecode.com/files/logintoboggan_rules-6.x....
Please find full configuration instructions inside the readme.txt present in the tarball.
Cheers,
Sudhir
hello Sudhir,Awesome work on
hello Sudhir,
Awesome work on the custom module! I will be testing it tonight when I get home.
In the README file it says: "3. For best results , uncheck the "Immediate login" option..."
I was wondering what this means? Does the option disrupt the custom module from working?
I currently have Immediate login enabled for my site. Users can still browse the site under the 'non-authenticated' role but a message shows at the top for them to validate for more access. When the user validates via the email link then i have a Privatemsg message sent to the user Welcoming them to the site and all the features they have access to now.
Thanks again!
Regards
No, this module just need the
No, this module just need the "Set Password" option to be set in logintoboggan settings.
You can safely ignore the "Immediate login" option because it doesn't have any effect if "Set Password" option is set.
Thanks for trying, Have a good day :)
Sudhir
Great! Thanks for the
Great! Thanks for the confirmation. I look forward to testing it and will report back if any issues.
tested the module just now -
Tested the module just now - works great! Thanks for the hard work Sudhir
I would suggest making a project page "LoginToboggan Rules Integration" to document this module for the benefit of the community
Regards
Still not able to get this
Still not able to get this working correctly.
Any help would be appreciated! =)
Thanks
I am looking for the same
I am looking for the same User has been validated Rule and was wondering if anyone can assist. Thanks!
User has been validated
Did the above solution by skporwal work or is this still needed?
Hello, No it did not work.
Hello,
No it did not work. Robby and I are still continuing to try to get this to work =/
I have it.
Hello trupal218,
I have it working. I created a module that adds a new event. This event is triggered when user uses the validation link via LoginToboggan. I just have a few loose ends to tie up.
It looks like to me the above solution doesn't work do to the fact that the event only fires when actually updating an account. The event is incorrect for what you want.
Great job
Great job skporwal on the module. I guess mine wont be needed.
I do disagree on the "Immediate login" option. If this option is set then the user is automatically logged in
and using the validation URL is invalid.Update: Looks like the validation URL still works and LoginToboggan event will still fire.
Hello, I came across one
Hello,
I came across one issue and hoping someone can help.
If a new user (who has not validated yet) receives a one-time login link in an email via Forgot Password page, this link acts as the validation link and the non-authenticated role set by LoginToboggan is successfully removed from the user. However, the issue is that the 'User has validated' event is not triggered by this action.
Is there anyway to trigger this LoginToboggan event for if the link sent by the Forgot Password page is used to not only log in the user but also used to validate the user?
I would really appreciate your help.
Thank you