Tagged: form
-
AuthorPosts
-
April 21, 2015 at 12:14 pm #431916
Hi!
Is there a way to get a custom email subject line from the form ?
We have a booking form, and we want to get some data that is entered in the form into the email subject line.
Is that possible ?
April 21, 2015 at 10:19 pm #432420Hi Paul!
Try this out, https://kriesi.at/support/topic/contact-form-customise-recipients-emails-subject/#post-140041.
Best regards,
ElliottApril 21, 2015 at 10:26 pm #432425Hi Elliot!
Thanx, but isn’t that the same as changing the subject line to a “static” one in the forms option, if left blank the subject line will be the default.
What i want to achieve is to have the subject line change depending on what is entered in the form. I.E have the name entered in the form incorporated in the email subject line.
Since the subject line is the same when we get them from the form it’s hard to separate the mails, or connect them to a certain client by just looking at the subject line.
Thanx
April 22, 2015 at 5:54 pm #433006Hi!
I haven’t tested it out but here is an example doing that, https://kriesi.at/support/topic/mail-subject/.
Here is another example, https://kriesi.at/support/topic/problem-with-contact-form-3/.
Regards,
Elliott- This reply was modified 9 years, 8 months ago by Elliott.
April 23, 2015 at 9:14 am #433311Thanx Elliot but i read those and tried them both but still get a empty subject line ?
It would be a lifesaver if we could get this to work!
Thanx
April 24, 2015 at 5:03 pm #434252Hi!
Your sure your using the correct label? https://kriesi.at/support/topic/mail-subject/#post-138438
Paste the code your using here.
Cheers!
ElliottApril 27, 2015 at 10:30 am #435125Hi i think i have the label correct.
The field i want to be the subject line from the form is the first “företag”
http://paullindqvist.se/gb/foretagspaket/
Code i pasted into the functions.php
add_action( 'wp_head', 'insert_fb_in_head', 5 ); add_filter('avf_form_subject','avia_change_mail_subject', 10, 3); function avia_change_mail_subject($subject, $new_post, $form_params) { $subject = $form_params['företag']; return $subject; }
April 28, 2015 at 4:34 pm #436164Hey!
That’s not the same code as Dude posted in the link I provided. Are you just trying to change the subject to “fortag”? If so then it would look like this.
add_filter('avf_form_subject','avia_change_mail_subject', 10, 3); function avia_change_mail_subject($subject, $new_post, $form_params) { $subject = 'företag'; return $subject; }
Best regards,
ElliottApril 28, 2015 at 4:39 pm #436172Hi Elliot correct i mixed the posts up.
I now tried the code at the bottom of the page you linked to.
add_filter('avf_form_subject','avia_change_mail_subject', 10, 3); function avia_change_mail_subject($subject, $new_post, $form_params) { $subject = urldecode($new_post['företag_'.(avia_form::$form_id - 1)]); return $subject; }
Still get a blank subject on the emails ?
Thanx!
April 29, 2015 at 5:27 pm #436866Hi!
I’m not sure. Perhaps the umlaut is causing problems. I would try looking into the contact form 7 or gravity forms plugins to see if they have this feature.
Regards,
ElliottApril 29, 2015 at 6:15 pm #436914What is the Umlauts ?
Is there any chance Dude can take a look and see why it’s not working ?
Would be great if i could get this working!
Thanx!
May 1, 2015 at 4:10 pm #438159Hey!
The umlaut is the o in fortag. Or maybe I’m using the wrong term.
I’ll go ahead and flag this for the rest of our team to see if they have any idea.
Best regards,
ElliottMay 2, 2015 at 11:42 pm #438426Oh i then i understand, i tried another field in the form, with no success.
Thanx!
May 8, 2015 at 4:14 pm #441595Hi!
Go ahead and send us a WordPress login and we’ll take a closer look.
Regards,
ElliottMay 8, 2015 at 6:35 pm #441719This reply has been marked as private.May 11, 2015 at 4:28 pm #442531Hi!
I do not see the code in your functions.php file. Where did you add it?
Cheers!
ElliottMay 11, 2015 at 4:37 pm #442539This reply has been marked as private.May 15, 2015 at 5:11 pm #445045Hey!
Try it out now.
Best regards,
ElliottMay 15, 2015 at 6:06 pm #445098This reply has been marked as private.May 15, 2015 at 7:17 pm #445118I saw the difference in the functions, copied it and it worked great! Thanx!!
Final question, is it possible to add a static text that will work in conjunction with the “foeretag” form label ?
Like “booking from “foeretag”
Regardless, thank you so much for the help!!
May 18, 2015 at 4:43 pm #445812Hi!
Yes, it would look something like this.
$subject = "booking from " . urldecode($new_post['företag_'.(avia_form::$form_id - 1)]);
And make sure “foretag” is using the correct ID that I set before.
Cheers!
ElliottMay 18, 2015 at 4:50 pm #445820Wow thank you! Worked perfectly!
Really appreciate the help!
Regards
Paul L. -
AuthorPosts
- The topic ‘Form email subject line’ is closed to new replies.