I have created a rule for sending an email after a new user registered. I would like to add a Rules Condition to send the email to the target based on the selection in the registration form.

For example: if I select the country as india I need to send to [email protected] and for other [email protected].

I have tried adding a condition in To mail receipt address:

$email = ($account->country == 'india'? [email protected] : '[email protected]')
echo $email;

Can you suggest how to handle the scenario?


1 Answer 1


You should be able to get this to work by creating a single rule using the Conditional Rules module (and Rules of course). The rule should be trigger by Rules Event "after saving a new user account".

For some samples to put together such rule (in Rules export format), refer to my answer to either of these questions:

The actual Rules Action you want to use, should be pretty similar to the Rules Action included in my answer to "How to send an email via a Rules action using a field key?".

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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