-
AuthorPosts
-
July 4, 2016 at 3:17 pm #656609
Hi there!!
I’ve inserted this function in my functions.php to modify the contact form autoresponder, but I’ve realized that only works with only one of them and I have eight different contact forms (from “avia_1_1” to “avia_1_8”).
function modify_autorespondermessage_func($message) { $new_message = "Hola ". $_POST['avia_1_8']."<br/><br/>"; $new_message .= $message; return $new_message; } add_filter('avf_form_autorespondermessage', 'modify_autorespondermessage_func', 10, 1);
Is it possible to modify the code to make it work with all 8 contact forms?
Thanks in advance for your help!!
July 7, 2016 at 10:59 am #657886Hey gofthet,
Thank you for using Enfold.
Could you please provide a link to the contact forms? Do you have different fields on these contact forms?
Best regards,
IsmaelJuly 7, 2016 at 8:50 pm #658212Well there are a lot, so I will give you credentials to the site. The contact forms are in the Popup maker plugin.
Thanks for your help.
July 10, 2016 at 4:51 pm #658966Any hint Ismael?
thx!!July 11, 2016 at 5:23 am #659071Hi,
I think you forgot the url to the site. Please provide links to two or three of the pages with the contact form.
Best regards,
IsmaelJuly 11, 2016 at 7:55 am #659102OMG!!! Sorry!!
July 13, 2016 at 4:36 am #660188Hi,
Is that the correct login url? I’m sorry but that page redirects to this one: http://www.seguridadalimentariaconbeatriz.com/404-pagina-no-encontrada/
And we need the actual url to the pages with the contact forms.
Best regards,
IsmaelJuly 21, 2016 at 1:28 pm #663391Sorry Ismael, the url is correct, it’s because the hosting provider bans the connection from abroad the country (Spain) for security reasons. Is it possible for you to connect through a VPN?
Thanks.July 25, 2016 at 2:20 pm #664634Hi,
Are you trying to add the value of the “Nombre” field? The “Nombre” fields inside the contact forms have different names or id attribute. You have to go to each page, inspect the “Nombre” field and get the name or id attribute. Screenshot of the “autocontrol” page and the “Nombre” field’s name attribute:
Use the following code, fill in the page name and the corresponding field name attribute value:
function modify_autorespondermessage_func($message) { global $post; $nombre = ''; switch ($post->post_name){ case 'autocontrol': $nombre = $_POST['avia_1_6']; break; case 'gestion-de-alergenos': $nombre = $_POST['avia_1_3']; break; case 'pagenamehere': $nombre = $_POST['avia_1_8']; break; case 'pagenamehere': $nombre = $_POST['avia_1_8'];; break; case 'pagenamehere': $nombre = $_POST['avia_1_8']; break; case 'pagenamehere': $nombre = $_POST['avia_1_8']; break; case 'pagenamehere': $nombre = $_POST['avia_1_8']; break; case 'pagenameheres': $nombre = $_POST['avia_1_8']; break; } $new_message = "Hola ". $nombre."<br/><br/>"; $new_message .= $message; return $new_message; } add_filter('avf_form_autorespondermessage', 'modify_autorespondermessage_func', 10, 1);
The “autocontrol” page is already filled, just follow the pattern.
case 'autocontrol': $nombre = $_POST['avia_1_6']; break;
Best regards,
IsmaelJuly 25, 2016 at 5:07 pm #664726First of all thanks for your help, I appreciate very much your work.
Here is the code I filled and put in functions.php, but the thing is that doesn’t work, I receive the first email but I don’t receive the autoresponder email.
Is there anything wrong in my code?
Is it possible that would be a problem having 2 different forms in the same page?Best regards,
function modify_autorespondermessage_func($message) { global $post; $nombre = ''; switch ($post->post_name){ case 'autocontrol': $nombre = $_POST['avia_1_6']; break; case 'gestion-de-alergenos': $nombre = $_POST['avia_1_3']; break; case 'trabaja-conmigo': $nombre = $_POST['avia_1_8']; break; case 'legislacion-gestion-online': $nombre = $_POST['avia_1_7']; break; case 'formacion-de-manipuladores-de-alimentos-online': $nombre = $_POST['avia_1_1']; break; case 'legislacion-gestion-presencial': $nombre = $_POST['avia_1_4']; break; case 'formacion-de-manipuladores-de-alimentos-presencial': $nombre = $_POST['avia_1_5']; break; case 'trabaja-conmigo': $nombre = $_POST['avia_1_2']; break; } $new_message = "Hola ". $nombre."<br/><br/>"; $new_message .= $message; return $new_message; } add_filter('avf_form_autorespondermessage', 'modify_autorespondermessage_func', 10, 1);
July 28, 2016 at 2:31 am #666011Hi,
We tried to access the wp-admin but it’s not working. What is the login url? Please post the WP and FTP login details so that we can check it.
Best regards,
IsmaelJuly 28, 2016 at 9:45 am #666095Hello,
It’s still being the same?
Are you connecting through a VPN?August 1, 2016 at 3:50 am #667111Hi,
No, I’m not connecting through any VPN. The wp-admin redirects to this page: https://www.seguridadalimentariaconbeatriz.com/404-pagina-no-encontrada/
Best regards,
Ismael -
AuthorPosts
- You must be logged in to reply to this topic.