I am having an issue using Auto Assign role with Rules.

My requirement is to use AAR to add a field to the user registration form that allows a user to sign up with a particular role, this works perfectly. Next I need an administrator of the site to receive an email when a user registers with that role. I am using rules to send an email. I set the rule event to: "User account has been created" and the condition to "User has role(s)" select the role just mentioned and then add the action to send the email. This does not work. It works fine if I leave off the condition for the role, but will not work if I add the role condition. This is leading me to believe that the rule is being evaluated and acted upon before the AAR module is assigning the role. Other hints to this are that in my log when I unset the condition for the role and create an account the rule shows up before the new account and I also receive the email from rules before I get the core user registration email.

I am not sure if this is the best place to put this issue, please reassign if necessary.

Any insight is greatly appreciated.

thanks!

CommentFileSizeAuthor
#1 aar.PNG7.23 KBRockSoup

Comments

RockSoup’s picture

StatusFileSize
new7.23 KB

here is an attachment showing rules appearing in the log before the account creation log entry.

Anonymous’s picture

I have a similar problem: I want an additional role assigned after the user creates an account as a role of his choice.
Have you found a solution to this?

EDIT: There was another setting under "Add user role" has had to be switched from "active user" to "registered user". Problem solved. Btw, this seems to be a very powerful function now that I think about it.

LiloLilo’s picture

#3 worket for me too. Thank you drupalsven!

matt.rad’s picture

#3 was what I have been looking for for days!

mike.davis’s picture

Component: Code » Documentation
Category: Bug report » Task
Issue summary: View changes

This seems to be more of a setting when defining the rule. Maybe the documentation just needs to be updated for use with rules.