Tagged: CONTACT FORM, subject line
-
AuthorPosts
-
September 23, 2017 at 1:31 pm #855797
Hi!
I wonder what code i should add to get change the subject line on two contact forms which is located on the same page ?
Today i use this code when having one form.
add_filter('avf_form_subject','avia_change_mail_subject', 10, 3); function avia_change_mail_subject($subject, $new_post, $form_params) { $subject = "Bokning från " . urldecode($new_post['1_1']); return $subject; }Is it possible to ID a form and then change the subject line ?
Thanx!
September 23, 2017 at 7:31 pm #855873Hey Paul,
Could you please give us a link to your website, we need more context to be able to help you.
Best regards,
VictoriaSeptember 23, 2017 at 8:00 pm #855890Hi!
Sure!
It’s one website for a restaurant that has two different menus and venues (though they are located just beside each other)
September 24, 2017 at 7:16 pm #856200Hi paullindqvist,
No, that code will apply to all forms. Can you give us temporary admin access to your website in the private content box below, so that we can have a closer look?
For more flexible contact forms experience, you could use a plugin, like Contact Form 7
https://contactform7.com/Best regards,
VictoriaSeptember 24, 2017 at 7:19 pm #856204This reply has been marked as private.September 25, 2017 at 3:12 pm #856502Hi paullindqvist,
You can try to id the form by the subject, not the optimal way, but could work.
Here is the code you can put in your funtions.php
add_filter('avf_form_subject','avia_change_mail_subject', 10, 3); function avia_change_mail_subject($subject, $new_post, $form_params) { if ($subject == "Bokning Indian Resturant" || subject == "Bokning Indian Bistro") { $subject = "Bokning från " . urldecode($form_params); } return $subject; }If you need further assistance please let us know.
Best regards,
Victoria -
AuthorPosts
- You must be logged in to reply to this topic.
