-
AuthorPosts
-
August 22, 2019 at 5:10 pm #1130044
hi there,
is it possible that the html field gonna be send too?thx in advaced :-)
August 22, 2019 at 8:59 pm #1130111Hey volmering,
Not sure what you mean, please do try explain a bit more and make your question clear.
Best regards,
BasilisAugust 23, 2019 at 12:45 am #1130163hey 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 :-)
August 26, 2019 at 3:38 am #1130817Hi,
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,
IsmaelAugust 26, 2019 at 2:05 pm #1130984hi ismael, thx alot.
the snippet works, but i need a snippet what insert the contact-form-html-element into the mail :-)
screenshot below
August 27, 2019 at 3:41 am #1131158Hi,
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,
IsmaelAugust 27, 2019 at 9:38 am #1131259hey 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, 3 months ago by volmering.
August 28, 2019 at 4:46 pm #1131651Hi,
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,
IsmaelAugust 28, 2019 at 10:41 pm #1131752hey 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.
August 29, 2019 at 3:48 pm #1131918 -
AuthorPosts
- The topic ‘Contact Form HTML Field’ is closed to new replies.