Viewing 9 posts - 1 through 9 (of 9 total)
  • Author
    Posts
  • #321101

    Dear Kriesi team,

    Would it be possible to use a variable name in the autoresponder text of the Enfold Contact Form element? A client wanted to use the name someone filled in on his site with the Enfold Contct Form, and use a “Dear |*FNAME*|, …” like construction in the autoresponder text. Is this possible or is this more something for a Contact Form 7, Gravity Forms, MailChimp sollution?

    Kind regards,
    Lucas van Heerikhuizen

    #322141

    Hi Lucas!

    Try adding this to your theme / child theme functions.php:

    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);
    

    Change “avia_nombre_1” by the name of the field you want to catch.

    Regards,
    Josue

    #466627

    Hi Josue,

    When add this to child theme function.php

    – there is no space between name and Dear (DearJosue)
    – between name and surname is %20 sign (DearJosue%20Moderator), and
    – would like to have one more empty line after Dear Josue Moderator, before body message starts.

    Can you help with this?

    #466738

    Hey!

    Can you paste the code you’re using?

    Regards,
    Josue

    #466751

    Hi Josue,

    Sure I can:

    function modify_autorespondermessage_func($message) {
    $new_message = “Dear”. $_POST[‘avia_name_1’].”<br>”;
    $new_message .= $message;

    return $new_message;
    }
    add_filter(‘avf_form_autorespondermessage’, ‘modify_autorespondermessage_func’, 10, 1);

    Btw, autoresponer emails are being sent more than two hours after form is submited? I know this is not connected with previous question, but, I just wonder if you have any idea why is that.

    Best,

    Ivan

    #467225

    Hey!

    Would suggest you putting another field for “surname” and change the code accordingly:

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

    Regards,
    Josue

    #467288

    Dear Josue,

    Thank you so much for great help and really quick response! It works flawlessly!

    Thanks again,

    Ivan

    #467294

    You are welcome Ivan, glad to help :)

    Regards,
    Josue

    #483631

    Hello. I opened a ticket similar to this…waiting to hear back. Thought I would try here as well to see if @simijonovic might be able to respond. I can launch this site once this final little piece gets implemented!!!


    @josue
    – Your first section of code only returns “Dear” for me. Your second section of code returns nothing for me.

    My post.

    Thank you!
    Ryan

Viewing 9 posts - 1 through 9 (of 9 total)
  • The topic ‘Add custom name to contact form autoresponder’ is closed to new replies.