How to save the data from the External form to the database and show it in the Form Results section

Permalink
As the post title, is it possible to save the data from the External form to the database and show it in the Form Results section. If so how is this done?

 
ronyDdeveloper replied on at Permalink Reply
ronyDdeveloper
You need to do some custom work to make it done. Firstly you need to create a controller file by which you can do the logic. Then write a jquery which will change the external form action and hold the original action into any hidden field. Then after submission, the action goes to controller and do required stuff and then you can redirect it to the original location. By this way it can be done.

But as I've mentioned at the top, it needs well amount of custom work.

Rony
magpie replied on at Permalink Reply
Thanks,

Would it then be possible to store the results in the form results in dashboard and send out the form data via email? Have you done this before, I could do with an example really...
ronyDdeveloper replied on at Permalink Reply
ronyDdeveloper
I'm not sure whether it can store the results in the form results in dashboard but you can write down code to send email easily. I've played a lot with these things with lot of tweaking. But not just the same.

Rony
magpie replied on at Permalink Reply
Maybe creating a form block and have that send out the form results externally via a controller?

Has anyone had any experience of having the best of both worlds whereby the form stores the results in the form results dashboard and also sends the email out as per an external form via a controller? Really need a solution to this!
nkennel replied on at Permalink Reply
nkennel
I could use this solution too, but the project isn't big enough to warrant the time to create the solution! But here's an idea I don't have time to try: Perhaps you could just extend the existing form block controller and modify it to send the email that you want. Then the form results would go to the dashboard, but it would send the email the way you want it. Maybe this can be done via a custom template so that it doesn't apply to all forms on the site. Let me know if you give this a try, and I'll do the same!

edit: I guess this is pretty much what you said! :-)
magpie replied on at Permalink Reply
I ended up doing just as you said, use the default form block. Data then goes to the dashboard and to get the email results sent to a custom email address i just added the following in the form controller file:

$formFormEmailAddress = 'info@example.com';

The form by default sends a email containing form results to the admin email address through this line in the controller so by inserting the above line below this it'll go to 'info@exmaple.com:

$formFormEmailAddress = $adminUserInfo->getUserEmail();

Rob