I have a very nice contact us page that I'm trying to build/convert into a plugin. I have the basic idea down... with a few tricky little issues I've run into.
Right now I have it set up so that if a particular page ID is displayed, it shows the contact us form. Works like a charm.
That contact us form is nested in an if/else selection inside a function on the plugin page. The form shows no problem at all.
Basically, there is a function of showContactUsForm and within there is an if statement looking for a hidden post value of 'Y' to determine whether the post request had been triggered. If the post value is 'Y' it sends the mail, if not - it displays the contact us form.
My issue is that I can't get it to actually trigger the mail to be sent. Here is what happens:
1) The contact us button is pressed.
2) The page is displayed with contact us form.
3) The vetting takes place w/in JS.
4) If all is well, when the submit button is placed, it triggers the page to refresh hitting the function and then the if/else statement again.
Unfortunately, when I hit submit upon successful validation, the page refreshes but no mail is sent and no contact us form is displayed :(
I'm trying to work into this and was wondering if anyone had any suggestions as to what I may be doing wrong.
Many thanks in advance!