Mautic Community Forums

Forms do not submit!

I’ve created the following:


  • Landing page with form
  • Form for landing page above
  • Thank you page, which is redirected to after submitting the form above on the landing page above
  • I created an email to be sent to the contact after the form is submitted, when trying to view the email after selecting it mautic gives an ‘undefined’ error even though the form is selected, my guess is this is the problem.



    The workflow should be:


  • User lands on landing page with form
  • User submits form and is redirected to the thank you page
  • User can download the offer or click to visit the main website
  • User is sent an email with the ebook attached and download link



    As I said above when trying to select the email on form action creation it selects the email but after applying the change or saving the form and opening it back up for editing and clicking the ‘preview email’ button it takes me to an error page with undefined, my guess is this isn’t attaching properly.



    When trying to submit the form on the landing page when I click ‘download’ the button changes to ‘please wait…’ and no redirect takes place and no email is sent.



    Any ideas on what I can check in order to get this working?



    Cheers

    Derek

I’ve created the following:

  • Landing page with form
  • Form for landing page above
  • Thank you page, which is redirected to after submitting the form above on the landing page above
  • I created an email to be sent to the contact after the form is submitted, when trying to view the email after selecting it mautic gives an ‘undefined’ error even though the form is selected, my guess is this is the problem.

The workflow should be:

  • User lands on landing page with form
  • User submits form and is redirected to the thank you page
  • User can download the offer or click to visit the main website
  • User is sent an email with the ebook attached and download link

As I said above when trying to select the email on form action creation it selects the email but after applying the change or saving the form and opening it back up for editing and clicking the ‘preview email’ button it takes me to an error page with undefined, my guess is this isn’t attaching properly.

When trying to submit the form on the landing page when I click ‘download’ the button changes to ‘please wait…’ and no redirect takes place and no email is sent.

Any ideas on what I can check in order to get this working?

Cheers
Derek

Just to make sure:

Where do you receive the error, when you are trying to view the email - probably you mean the /email/preview/# URL, right? Is there the proper ID number of the email in the preview URL?

Also, are there any errors logged in the Mautic application log, as well as in the webserver’s error log? (/var/log/apache or similar)

Furthermore, how do you send emails? Did you set up the form as ‘campaign form’ and have a campaign that handles contact from that form, and sends them the email?

I am asking since I am not totally sure how you’re doing it. Nevertheless, looking at the log files should give you the insight on what could be wrong.

Best,
D.

Hi @denispavliha,

There are no errors, the form was set up as a standalone form with a redirect to the thank you page.

Yes the preview button takes me to /email/preview/undefined, the button itself has the following onclick event Mautic.loadNewWindow(Mautic.standardEmailUrl({“windowUrl”: “/email/preview/emailId”}))

I can preview the email via the preview url when the editing feature is closed, that works, but the button inside the editing function does not.

I have the system set to send via SMTP, which all seems to be successful, that being said every time I ask the system to send me a preview no emails are sent or received anyway, where can I view the queue?

Here is the landing page: click here.

Thanks
Derek

Further to this I recreated the form as a campaign form and created a campaign but it has the same results, it doesn’t redirect or submit the form once clicked, it’s really weird.

I managed to create another campaign for adding visitors to a blog segment, which works perfectly, all that’s used though on that is a form with no landing page and no redirect after submit as I have it showing a message instead, which works.

I just noticed the following errors on the landing page:

Mautic tracking is not initiated correctly. Follow the documentation. mtc.js:11 Mautic tracking is not initiated correctly. Follow the documentation.

Then there is a bug report here: https://github.com/mautic/mautic/issues/2902

It looks like an issue with the landing pages by the looks of it?

It’s the version 2.4, the forms do work when they aren’t on a Mautic landing page.

I have version 2.3 on another site and that same issue exists before upgrading to version 2.4.

I manually created a new instance of Mautic using a new file set and only bringing over the local.php file and the custom themes, but the same problem exists.

I have tried changing the php version from 5.6x to 7.0x, which didn’t work and 7.1x which didn’t work as it’s not compatible.

I’ve also tried changing the theme to a default theme but the same issue exists.

Thanks
Derek

Thanks for the help, I’ve done this already, indeed everytime I make a change I always clear the cache completely.

Let me organise the Nginx config.

@MxyzptlkFishStix apparently our cloud hosting platform can’t provide the full config, is there something specific that I should check?

Its SiteGround :slight_smile:

I asked for SG to investigate the server since this is happening on all instances including version 2.5, here is their response:

We have examined the server error logs in detail and there are no server failures nor errors being logged as the process fails to execute. The only error we managed to detect was when accessing the page and inspecting it with developers console it renders:

Mautic tracking is not initiated correctly. Follow the documentation.

I have tried switching the application between multiple PHP version but to no avail. I also traced the execution process when the button is clicked but I was unable to find any reason as to why nothing else happens as the execution appears to finishes successfully.

Our Technical Support Team is specialised in providing assistance in case your script is not accessible due to a problem with your host server or a vital service running on it. Third-party application-related problems such as this are at times beyond the scope of our expertise.

There must be a reason why the script is not sending the forms or executing properly, any ideas?

Thanks
Derek

Hey @DerekBuntin just for the heck of it, try commenting out the addthis script from the footer. It may be clashing. Another interesting thing is that the submit does occur, but the response seems to indicate that required fields are not filled in. this is the response… (I decoded it for you)

<html>
    <head>
        <script type="text/javascript">
            parent.postMessage("{"success":0,"validationErrors":{"company":"Required!","website":"Required!"},"formName":"howtoconductareturntoworkinterviewebook"}", '*');
        </script>

        <script>
	(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
...
	ga('create', 'UA-nnnnnnnn', 'auto');
	ga('send', 'pageview');
</script>    </head>

    <body></body>
</html>

So you might want to check if you have lingering fields or make up a new form and try.

@MarkLL I’ve tried creating a new form, the first was standalone so created a campaign form.

What you’ve posted clearly shows that the company and website etc are required fields, which are correct but they should only be included once the previous fields have been completed, therefore I would suggest that’s a bug, since iI want those to be required but only if they are showing on the form, which at the outset they are not because it’s supposed to be progressive profiling.

Anyway, I’ve just removed those required fields and hey presto, it works!

Thank you, I should’ve known better to check the response in the inspector, not sure how I managed to forget that :slight_smile:

Now on to finding out the reasons why the emails are not sending… :slight_smile: