How to use Rules to send an email to an email id based on a selected in a registration form? 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 india@gmail.com and for other others@gmail.com.

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

$email = ($account-&gt;country == 'india'? india@gmail.com : 'other@gmail.com')
echo $email;


Can you suggest how to handle the scenario?
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:


How to set the values of some fields depending on the value of a list box?
How to specify a Rules condition related to select list values?


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?".