Posts: 2
Threads: 1
Joined: Oct 2011
Reputation:
0
Firstly I apologize, as I'm sure this is a simple thing, unfortunately I too, am simple!!
I have Form Tools 2.1 installed, my form created, form submissions are updating the db and everything is successful so far (a BIG thank you to the Form Tool developers, btw!!).
Now all I need to do is query a separate table in my db (to lookup a code), based on a value entered into my form, and email that code to the address entered into the form.
Is there an easy way to do this? Thank you in advance, I appreciate any help I can get!
Posts: 2,456
Threads: 39
Joined: Dec 2008
Reputation:
6
Hi Kevin,
Welcome to the forums!
Interesting question. So you have a totally separate (non-Form Tools) database containing data that you need to interact with? Neat... is it on the same server as your Form Tools installation?
I'm afraid I don't have any easy solutions. To get it to all work within the Form Tools interface (which would be best, of course) you kind of need to write a separate module. I'd tackle it like this: create a module with a template hook to display a "find key" section on the form submissions page which when entered, would send an Ajax request to get back the info. You could then feed that into the form submission, update it, then use the email templates functionality to create a default email template targeted at the appropriate recipient & containing that data.
Sorry, that was pretty high level. But it's non-trivial.
Alternatively...
Do you need to do the lookup right before emailing? Instead, could you grab the data from your second database table when the original form submission is put through? If so, you could create some code in the Submission Pre-Parser module to run on the server and store the appropriate code in the Form Tools table for each submission, right from the start.
But I gotta be honest: this is all pretty complicated and you'll need a developer handy.
Sorry I couldn't be more help...!
- Ben
Posts: 2,456
Threads: 39
Joined: Dec 2008
Reputation:
6
Hi Kevin,
I wish I had some better news, but I don't have much to suggest! One of the modules I mean to work on is to allow mapping of data between one form to another, but it's not #1 on my list yet: I had a pile of contract work to get through, plus I need to release the upcoming Form Builder module.
Sorry about that - but good luck finding a solution...!
- Ben