I created a form (via the webform module) that is going to be used for website visitors to contact staff members. The url for the form includes a parameter with the staff members id# that is saved as a hidden field with the submission.
I then created a rule with 2 actions:
The first action (execute php code) retrieves the hidden field with the staff members id# and performs a database query to retrieve their email address. Result of query is $email.
The second action (send html email) is used to send an email to the staff member the submission was meant for.
The problem: I want to use the result of the database query in action 1 to dynamically fill the recipient field in action 2. I can't find the proper formatting to call the result from action 1. I can insert the query into the body of the email in action 2 and it executes and then will display the result. I tried using
Is there a way to pass data from one action to another within the same rule?