Tagged: CONTACT FORM
I would like to know if there is a hook or a simple way to automaticly add some text to every email sent for a contact form element.
Basically, I would like to add all the logged in user meta on top of every contact form element’s email without having the fileds on the form.
If there is no hook for that, maybe you can point me out the php file where the emails are generated and sent so i’ll just add my code there in my child theme
Hey lepetitweb!
There is a hook for there, check the example here:
add_filter('avf_form_from', 'avia_change_from', 10, 3);
function avia_change_from($from,$new_post,$params){
$from = ' (Email address hidden if logged out) ';
return $from;
}
For example, on he following you can change the form email.
Do you need more info to work around with it?
Regards,
Basilis
great what would be the hook for modifying the email content??
A very little sample just like the 1 you sent would be exactly what i am looking for!!!
Thanks a bunch
Hi!
Please refer to this link in order to modify the email message: https://kriesi.at/support/topic/contact-form-indicator/#post-293282
Basically, you have to use the filter in the functions.php file:
function change_form_message($message) {
$message .= "ADDITIONAL CONTENT HERE";
return $message;
}
add_filter('avf_form_message', 'change_form_message');
Best regards,
Ismael
thanks a lot link is exactly what i wanted.