Viewing 8 posts - 1 through 8 (of 8 total)
  • Author
    Posts
  • #587680

    Good morning!

    We want to include the name of the person who contact us recovering the name field content that he has fill in the form and put this in the autoresponse text. Does exist any shortcode for recover data from the fills of the form?

    Best regards,

    SMS PRO

    • This topic was modified 8 years, 10 months ago by SMSPRO_CENTRAL. Reason: notify me
    #588964

    Hi,

    The following code should do the work but you may need to change avia_nombre_1 according to your form structure:

    function modify_autorespondermessage_func($message) {
    	$new_message = "Dear". $_POST['avia_nombre_1']."<br>";
    	$new_message .= $message;
    
    	return $new_message;
    }
    add_filter('avf_form_autorespondermessage', 'modify_autorespondermessage_func', 10, 1);

    Can you post the link to your form page please?

    Regards,
    Josue

    #589040

    Thanks Josue!

    I understand that i have to introduce this code in functions.php changing the “avia_nombre_1” for “avia_nombre_y_apellidos_1”, according to this form http://smspro.es/contacto/ for example

    function modify_autorespondermessage_func($message) {
    	$new_message = "Dear". $_POST['avia_nombre_y_apellidos_1']."<br>";
    	$new_message .= $message;
    
    	return $new_message;
    }
    add_filter('avf_form_autorespondermessage', 'modify_autorespondermessage_func', 10, 1);

    Regards,
    SmsPro

    #589066

    Correct, have you tested it? did it work?

    #589941

    YESS! it works .. Thank you very much …
    I added in the function urldecode() for space and accents

    function modify_autorespondermessage_func($message) {
    
            $nom=  urldecode($_POST['avia_nombre_y_apellidos_1']);
    	$new_message = "Dear". $_nom."<br>";
    	$new_message .= $message;
    
    	return $new_message;
    }
    add_filter('avf_form_autorespondermessage', 'modify_autorespondermessage_func', 10, 1);

    Regards,
    SmsPro

    #590086

    You are welcome, glad to help :)

    Regards,
    Josue

    #646194

    Hello again!

    I would like you to ask how can i do the same with a more complex website in different languages, i would like to recover the fields in those languages independently and i am using the plugin Polylang. I want the autoresposive text in the appropriate language.

    Let me know if you want to access to the website or anything!

    Regards!

    #646529

    Hi,

    I think it would be more convenient to use a specialized form plugin like:
    https://wordpress.org/plugins/contact-form-7/

    Best regards,
    Josue

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