Mail plugin on submitting form to execute a php sql query and return data with email

mkainz

Member
When user submit the form, how can I make it work this way:

The user submit form.
The php script execute a sql query like "where email found return value DATA", inject DATA in the email that the script is going to send and send a copy of the email to the submitting user.

Is it possible to do something like that?
 
I think this is not possible with email form plugin.
Try to use php form plugin and process script End of for submission(onAfterProcess).
 
Just done!
I tried with php plugin in combo with email plugin, yeah it returned the value but not added it to the email unfotunately.
So here's the workaround I used:

I used a hidden calc plugin element to do the php query (and used it to calc once the form is submitted), then with the {table__formdata} I got the word to search then with a "return $variable" I got the query result I needed.
Then i added the mail plugin to the form and BOOM! It worked.
For everyone could need it in the future. :D
 
We are in need of some funding.
More details.

Thank you.

Members online

Back
Top