Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #1486948

    Hi all, I’m wanting to edit the autorespond text to my contact form to pull in the “name” field from the form (ie ‘Hi [Name], thanks for reaching out…” Is there any way to do this? Thanks!

    #1486962

    Hey lfs360,

    Thank you for the inquiry.

    You can try adding this filter in the functions.php file to prepend additional content before the autoresponder message.

    add_filter('avf_contact_form_autoresponder_mail', function($mail_array, $new_post, $form_params, $class) { 
        $mail_array['message'] = '<p>Hi ' . $new_post['1_1'] . '</p><br/>' . $mail_array['message'];
        return $mail_array;
    }, 10, 4);
    

    The part $new_post[‘1_1’] assumes that the name is entered in the first field of the contact form.

    Best regards,
    Ismael

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