Viewing 10 posts - 1 through 10 (of 10 total)
  • Author
    Posts
  • #1130044

    hi there,
    is it possible that the html field gonna be send too?

    thx in advaced :-)

    #1130111

    Hey volmering,

    Not sure what you mean, please do try explain a bit more and make your question clear.

    Best regards,
    Basilis

    #1130163

    hey basilis,

    i placed a snippet in my functions.php that creates a shortcode.

    this shortcode “[titel]” i placed in the contacform-html-element. (screenshot and test-page below)

    reason is following: i need several contact-formulars and the receiver of the mail (my customer) should get an information from what page the formular was sent.

    sorry for my bad english :-)

    #1130817

    Hi,

    Thank you for the update.

    You can use the following filter in the functions.php file to insert additional text to the email message.

    add_filter('avf_form_message', 'avf_form_message_mod', 10, 3);
    function avf_form_message_mod($message, $new_post, $form_params) {
        $message = "ADD TEXT HERE" . $message;
        return $message;
    }
    

    Best regards,
    Ismael

    #1130984

    hi ismael, thx alot.

    the snippet works, but i need a snippet what insert the contact-form-html-element into the mail :-)

    screenshot below

    #1131158

    Hi,

    Thank you fro the update.

    The HTML element is not an input field, so it won’t get included in the email content, but you can add it manually using the filter above. Are you planning to add multiple forms in a page? If not, then you can use the is_page conditional function to add different text for a contact form in a specific page.

    add_filter('avf_form_message', 'avf_form_message_mod', 10, 3);
    function avf_form_message_mod($message, $new_post, $form_params) {
        if(is_page(23)) {
            $message = "ADD TEXT HERE" . $message;
        }
    
        if(is_page(42)) {
            $message = "ADD ANOTHER TEXT HERE" . $message;
        }
    
        return $message;
    }
    

    Best regards,
    Ismael

    #1131259

    hey ismael, thx alot again for trying to help :-)

    sorry for my bad english again. i try to explain it from the beginning :-)

    my customer has a property-website. he wants to have a sample-single-property-portfolio (avia-layout), wich he can duplicate, fill out the data and publish this portfolio. but he wants as little effort as possible. so he dont wants to change the contact form everytime too.
    the only problem: how to distinguish the messages? —–> my thoughts were, when i can inculde the html-element in the email content my problems are gone,

    in the end i just need that the form get the title of the page/portfolio automaticly.

    • This reply was modified 5 years, 2 months ago by volmering.
    #1131651

    Hi,

    Thank you for the update.

    in the end i just need that the form get the title of the page/portfolio automaticly.

    If that’s what you need, then you can use the same filter above with a bit of modification.

    add_filter('avf_form_message', 'avf_form_message_mod', 10, 3);
    function avf_form_message_mod($message, $new_post, $form_params) {
        global $post;
        $title = get_the_title($post->ID);
    
        $message = $title . '' . $message;
        return $message;
    }

    Best regards,
    Ismael

    #1131752

    hey ismael,

    this is magnificent :-)

    i just changed it a bit (because of the linebreak) to:

    add_filter('avf_form_message', 'avf_form_message_mod', 10, 3);
    function avf_form_message_mod($message, $new_post, $form_params) {
        global $post;
        $title = get_the_title($post->ID);
    
        $message = $title . '<br>' . $message;
        return $message;
    }
    

    thanks alot man.

    #1131918

    Hi,

    You’re welcome! Please don’t hesitate to open a new thread if you need anything else.

    Have a nice day.

    Best regards,
    Ismael

Viewing 10 posts - 1 through 10 (of 10 total)
  • The topic ‘Contact Form HTML Field’ is closed to new replies.