Tagged: CONTACT FORM
-
AuthorPosts
-
March 3, 2016 at 4:30 am #592394
I would like to have something like the issue that was brought up in this old post from 2013:
https://kriesi.at/support/topic/mail-subject/
When a visitor sends a message using the contact form, the default subject is “New Message (sent by contact form at ******)” in the email that we receive. Is it possible to change this? I have a field called Subject in the contact form, when a visitor writes a subject of their mail I would like that to be shown instead of the default.
We’ve tried altering the functions.php with the code suggested there:
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['subject_'.(avia_form::$form_id - 1)]); return $subject; }
But clearly that code no longer works with the way the new Contact Form is set up.
Can someone help with an updated solution?
March 4, 2016 at 10:14 pm #593555Hey reynoldsphobia!
To customize the subject please check https://kriesi.at/support/topic/mail-subject/#post-138433
To customize other email messages add the below code in your functions.php by going to appearance > Editor > functions.php
Please use a child theme so your changes remain intact when you update the main theme.
kriesi.at/documentation/enfold/using-a-child-theme/
add_filter('avf_mailchimp_messages', 'avf_mailchimp_messages_mod', 10, 1); function avf_mailchimp_messages_mod($message) { $message['email'] = __('Please provide a valid email address.', 'avia_framework'); $message['all'] =__('Please fill in all required fields.', 'avia_framework'); $message['already'] =__('This email address is already subscribed, thank you!', 'avia_framework'); $message['general'] =__('We are very sorry but something went wrong. Please try again later.', 'avia_framework'); $message['invalid_field'] =__('Please make sure that your fields are filled in correctly', 'avia_framework'); return $message; }
Cheers!
Vinay KashyapMarch 7, 2016 at 10:29 pm #594622Thank Vinay, but this is not about the Mailchimp widget. This is instead about the standard Contact Form Content Element.
The thread you reference above as a solution to the subject line issue (that the subject field on the sent email from the contact form does not pull the subject text from the subject field in the form):
To customize the subject please check https://kriesi.at/support/topic/mail-subject/#post-138433
is the exact same thread that I reference in my initial post, explaining that the solution (from 2013) no longer works with the current Contact Form Content Element. I’m looking for a solution to the current version (Enfold 3.4.7).
Thanks.
March 12, 2016 at 8:48 am #597166Hey!
The label identifier has been removed to prevent conflict on complex forms.Please replace the code with this: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['avia_3_1']); return $subject; }
Regards,
IsmaelMarch 12, 2016 at 5:26 pm #597227Thanks, Ismael, but this just returns emails with “(no subject)” in the subject line.
March 14, 2016 at 8:43 am #597610Hi!
Did you fill in the Subject field in the contact form? http://nevermindgame.com/hello/
Cheers!
IsmaelMarch 14, 2016 at 9:35 am #597621Hi!
UPDATE: Please replace the code in the functions.php file with this:
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['3_1']); return $subject; }
Best regards,
IsmaelMarch 23, 2016 at 5:39 am #602302Thank you so much, Ismael! That seems to have done the trick with the adjustment in the third line of code!
Many thanks! I know there are several support threads out there regarding this issue, so hopefully this will help someone else as well!
March 25, 2016 at 9:37 am #603597 -
AuthorPosts
- The topic ‘Email Subject from Contact Form Subject’ is closed to new replies.