Posted by erlingpj on June 16, 2011 at 4:10pm
I have a custom node type that contains a e-mail field.
Can I use Rules to check if the e-mail excists from before (when the anonymious user adds content to the node), if not then create a new user in Drupal.
Comments
Sure
That could be done, but with a little tinkering + using Rules Bonus.
1) Create a view of users, taking an e-mail address as argument/contextual filter and displaying "all" (max 1) user with that particular e-mail.
2) Have a reaction rule/triggered rule to react when new nodes of your special type are created.
3) Run a condition "Check number of view results" (available in Rules Bonus Pack), so see if the view returns zero users.
4) If so, create a new user – probably using the e-mail address as user name as well as address (if you don't want to mess with verifying that user names are valid and available)
Good luck!
//Johan Falk
**
Learn Drupal with Nodeone! Drupal 7 introduction | The Views module | Learn Page manager! | Drupal configuration learning curve | Learn Drupal coding | Rules for Drupal 6 | Theming Drupal 6 | 49 Drupal 6 modules you should know