Your software
My Mautic version is: 2.15.1
My PHP version is: 7.1.28
Your problem
My problem is: the email-subscription Mautic form embedded in the WordPress web pages do not work properly—it either doesn’t show up at all, or it hangs with ‘please wait’ message when submitted, and fails to display the pre-assigned form submission message—although the contact gets created in Mautic.
These errors are showing in the log: No error in the Mautic log.
Steps I have tried to fix the problem:
I have read the following relevant references.
https://forum.mautic.org/t/form-submission-hanging-on-the-please-wait/10439
https://forum.mautic.org/t/problem-with-integration-form-mautic-and-wordpress/5627
https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/X-Frame-Options
https://stackoverflow.com/questions/38744953/apache-x-frame-options-allow-from-multiple-domains
I have added the following in the Apache server configuration file, /opt/bitnami/apache2/conf/httpd.conf
, in two places.
Header always append X-Frame-Options "ALLOW-FROM https://mail.asianamericanman.com/"
Header always append X-Frame-Options "ALLOW-FROM https://mail.intellectualwomanhood.com/"
Header always append X-Frame-Options "ALLOW-FROM https://mail.intellectualmanhood.com/"
The following settings are now present in the Apache server configuration file.
<IfModule headers_module>
<IfVersion >= 2.4.7 >
Header always setifempty X-Frame-Options SAMEORIGIN
Header always append X-Frame-Options "ALLOW-FROM https://mail.asianamericanman.com/"
Header always append X-Frame-Options "ALLOW-FROM https://mail.intellectualwomanhood.com/"
Header always append X-Frame-Options "ALLOW-FROM https://mail.intellectualmanhood.com/"
</IfVersion>
<IfVersion < 2.4.7 >
Header always merge X-Frame-Options SAMEORIGIN
Header always append X-Frame-Options "ALLOW-FROM https://mail.asianamericanman.com/"
Header always append X-Frame-Options "ALLOW-FROM https://mail.intellectualwomanhood.com/"
Header always append X-Frame-Options "ALLOW-FROM https://mail.intellectualmanhood.com/"
</IfVersion>
RequestHeader unset Proxy
</IfModule>
I used the following command to restart the Apache server.
sudo /opt/bitnami/ctlscript.sh restart apache
In Google Chrome, I’ve turned on Developer Tools (Ctrl+Shift+I), selected the Network tab, and visited the web page with the embedded Mautic form. The Response Headers section of the website shows the following.
X-Frame-Options: SAMEORIGIN, ALLOW-FROM https://mail.asianamericanman.com/, ALLOW-FROM https://mail.intellectualwomanhood.com/, ALLOW-FROM https://mail.intellectualmanhood.com/
The above seems to show that the additional X-Frame-Options work correctly.
However, the problem still persists.
Additional details*
Apache version is 2.4.39.
The websites are on an AWS Lightsail instance with Bitnami WordPress Multisite 5.1.1-2. The WordPress version is 5.2.3.
The Mautic installations are on an AWS Lightsail instance with Bitnami LAMP 7.1.28-0.
The iframe Mautic-form code, when included in an WordPress page, shows ‘mail.intellectualwomanhood.com refused to connect.’ error on the WordPress web page, and does not display the Mautic form.
<iframe src="//mail.intellectualwomanhood.com/iwmautic/form/13" width="300" height="300"><p>Your browser does not support iframes.</p></iframe>
The Mautic web page included in the iframe element, https://mail.intellectualwomanhood.com/iwmautic/form/13, shows up fine when directly visited, so it doesn’t seem like a Mautic problem. When the form is submitted on https://mail.intellectualwomanhood.com/iwmautic/form/13, it doesn’t hang, and the form-submission message is properly displayed.
All the other means of embedding the Mautic form (automatic JavaScript, manual JavaScript and CSS and HTML inclusion, and Mautic-form WordPress shortcode), all result in the ‘please wait’ hanging Mautic form submission problem (without any Mautic error in the Mautic log).
It looks like the Apache web server is blocking all the external data (the iframe and the data coming from the Mautic instance). However, embedded YouTube videos on the WordPress web pages work fine, so likely the iframe problem is specific to Mautic.
The URL of the WordPress website is https://intellectualwomanhood.com; the URL of the Mautic instance is https://mail.intellectualwomanhood.com/iwmautic.
In the Mautic Configuration, Site URL is set to https://mail.intellectualwomanhood.com/iwmautic.
In the Mautic Configuration, CORS Settings: Restrict Domains is set to yes, and https://intellectualwomanhood.com and https://www.intellectualwomanhood.com are set as the valid domains.