Viewing 22 posts - 1 through 22 (of 22 total)
  • Author
    Posts
  • #483055

    Hello. Looking to customize the message that is emailed out via the contact form.

    Request 1: I”d like to see “Dear [First Name] [Last Name],” above the message body. Right now, nothing is returned. I had it returning something before, but had the same issues as seen in this post. My current code is listed below.

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

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

    Request 2: Client wants to see “Thank You for your inquiry!” for the subject of the email that is sent out via the contact form. Right now I’m seeing “Thank you for your Message!” and I can’t see where to change it. I know it’s being picky on their part, but a future client want this to be extremely specific per each form.

    Thank you,
    Ryan

    #483743

    I’m having the same problem as request 2. I can change the subject in the contact form settings, but it still sends out “Thank you for your message!” no matter what i type or if I leave it blank.

    #483885

    Finally found a solution to #2. I added the following to my Enfold Child Theme’s functions.php.

    /*
    * Changes the Subject Line of the Enfold Contact Form’s autoresponse.
    */
    add_filter( ‘avia_contact_form_args’, ‘enfold_customization_autoresponsder’, 10, 1);
    function enfold_customization_autoresponsder( $form_args ) {
    $form_args[‘autoresponder_subject’] = ‘Thank You for your inquiry!’;
    return $form_args;
    }

    #483910

    Request 1

    Getting VERY close. It looks like someone helped out a bit overnight. Currently, the autoresponder is showing “Dear JohnSmith”. I can’t figure out how to add in the “:” and the space between the first and last name…without breaking the functions.php

    Top Wish: For the autoresponder to show “Dear: John Smith”

    Acceptable Wish: For the autoresponder to show “Dear John Smith”

    Thank you,
    Ryan

    • This reply was modified 9 years, 3 months ago by WP Turned UP.
    #483945

    Hell Yeah! After some more research, my Top Wish is granted! I think this will help a lot of other folks out there.

    Contact Form
    Within your contact form, create a First Name field and a Last Name field.

    Add the following to your Enfold Child Theme functions.php
    /*
    * Using the Enfold Contact Form autoresponder, this will output the First and Last name of the person filling out the contact form.
    */
    function modify_autorespondermessage_func($message) {
    $new_message = “Dear: ” . $_POST[‘avia_first_name_1’]. str_repeat(” “, 1). $_POST[‘avia_last_name_1’].”<br>”;
    $new_message .= $message;

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

    Output will be:“Dear: First Name Last Name” (Dear: John Smith)

    • This reply was modified 9 years, 3 months ago by WP Turned UP.
    #484254

    Hey!

    Glad you managed to sort it out, let us know if you have any additional questions.

    Cheers!
    Josue

    #484325

    Great job working that out Ryan!

    Changing the subject line in the autoresponse, should still be possible without adding to the theme, since it’s an option in the contact form settings.

    #484462

    Hey!

    Thanks for sharing your solution Ryan!

    Regards,
    Yigit

    #1060558

    Hello!

    I am trying to get this to work with small variation: only surname (and in Dutch). I use the following code (thanks to WP turned up):

    function modify_autorespondermessage_func($message) {
    $new_message = "Geachte heer/mevrouw " . $_POST[‘avia_Name_1’]. "<br>";
    $new_message .= $message;
    
    return $new_message;
    }
    add_filter(‘avf_form_autorespondermessage’, ‘modify_autorespondermessage_func’, 10, 1);
    

    But I can’t get it to work. I tried name (no caps), Naam and naam (Dutch for name as the field names are in Dutch in my version) but to no avail.
    Clearly I am doing something wrong. The question is: what? :-)

    #1061637

    Dear Kriesi team,
    Is there someone of you who can shed some light on this matter?
    I added my question to this thread as it seams related, but if you want me to open another thread , please let me know

    Best!
    Jan

    #1061670

    Hi Jan,

    Where are you adding the code?

    Should this be like this?

    $_POST[‘avia_name_1’]

    https://kriesi.at/support/topic/add-custom-name-to-contact-form-autoresponder/#post-467225

    Can you give us temporary admin access to your website in the private content box below, so that we can have a closer look?

    Best regards,
    Victoria

    #1061690

    Hi Victoria,

    As I mentioned I also tested it with lower caps (avia_name_1). To be sure I just tested it again and the result is the same: the name is not added

    I am adding the code to the functions.php in the child theme.

    Please see the private section for the credentials

    Best regards,
    Jan

    #1062297

    Hi Jan,

    Thank you, though credentials did not work for me. Could you please update the credentials?

    Best regards,
    Victoria

    #1062648
    This reply has been marked as private.
    #1063307

    Hi Jan_FtFA,

    Best regards,
    Victoria

    #1063558
    This reply has been marked as private.
    #1064640

    Hi Jan_FtFA,

    https://cl.ly/b9e97e340098 The message was not empty. My message was in private.

    Please check.

    Best regards,
    Victoria

    • This reply was modified 5 years, 9 months ago by Victoria.
    #1066105
    This reply has been marked as private.
    #1066961

    Hi Jan,

    I still cannot login. I’ll ask my colleagues to check.

    Best regards,
    Victoria

    #1067251

    Hi,
    I was able to login, and found that you had some “curly quotes” in your code. I removed, please try now.

    Best regards,
    Mike

    #1069968

    Hi Mike,
    Thanks for looking into this matter. Together with your “curly” corrections I worked it out. The field name is: avia_5_1

    For those interested, the correct code is:

    function modify_autorespondermessage_func($message) {
    $new_message = "Geachte heer/mevrouw " . $_POST['avia_5_1']. ",<br><br>";
    $new_message .= $message;
    
    return $new_message;
    }
    add_filter('avf_form_autorespondermessage', 'modify_autorespondermessage_func', 10, 1);
    

    Note: In my case the var name is ‘avia_5_1’. Obviously this can be different for other forms. You can check the correct name with your browser dev tool

    Best regards,
    Jan

    • This reply was modified 5 years, 9 months ago by Jan_FtFA.
    #1070152

    Hi,
    Glad to hear, thanks for using Enfold.
    For your information, you can take a look at Enfold documentation here
    For any other questions or issues, feel free to start new threads under Enfold sub forum and we will gladly try to help you :)

    Best regards,
    Mike

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