Viewing 13 posts - 1 through 13 (of 13 total)
  • Author
    Posts
  • #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!!

    #657886

    Hey 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,
    Ismael

    #658212

    Well 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.

    #658966

    Any hint Ismael?
    thx!!

    #659071

    Hi,

    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,
    Ismael

    #659102

    OMG!!! Sorry!!

    #660188

    Hi,

    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,
    Ismael

    #663391

    Sorry 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.

    #664634

    Hi,

    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:

    View post on imgur.com

    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,
    Ismael

    #664726

    First 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);
    #666011

    Hi,

    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,
    Ismael

    #666095

    Hello,
    It’s still being the same?
    Are you connecting through a VPN?

    #667111

    Hi,

    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

Viewing 13 posts - 1 through 13 (of 13 total)
  • You must be logged in to reply to this topic.