Emails sent to specific, but different, users each time form is used

Status
Not open for further replies.

degarrin

Member
I have built a couple of request-type forms that "User A" fills out, and when he submits it, an email is sent to "User B." Then "User B" goes into the form and indicates the final outcome in a special "Official Use Only" section of the form that only a few users can access. The two forms I have that use this feature is a membership application and an event proposal (for trips, educational outings, etc). This is already set up using the standard email form plugin and has been working fine.

Now I would like to add an option for "User B" to be able to click an option inside the forms and generate another email to "User A" letting him know the outcome of the form request, which would vary depending on the form. The challenge is that "User A" and "User B" might be different users each time. So, what is the best way to accomplish this? Can code be written for the button element plugin to pull in the specific user (User A in my example) and email certain text, and if so, how would I go about doing that? Or would a different plugin be a better option?

Thanks!
Angela
 
ok So I presume you have :

* a field that stores User A's email address , which is filled in when User A fills in the form. (full element name = "trips___usera")
* That there is a field say 'approved' which is visible only to User B. Lets say that when the record is approved the value is set to '1' and its default is 0 (full element name "trips___approved")


In your form you would edit your first email plugin and in the condition field enter:

PHP:
return '{trips___approved_raw}' == 0;
This says to send the mail only when the trip isn't approved.
Then add a new email plugin, set the to option to
Code:
{trips___usera}
to send the email to userA
And add a condition:
PHP:
return '{trips___approved_raw}' == 1;
so that the email is only sent when approved
See the docs for further info regarding the email settings: http://fabrikar.com/forums/index.php?wiki/email-form-plugin/
 
Rob, that was exactly what I needed and it works wonderfully. I so did not get that I could configure the email plugin to go to one user that way :oops:, so thanks for explaining it to me so clearly because it will really help out with these forms a lot!

Angela
 
Status
Not open for further replies.
Back
Top