-
AuthorPosts
-
August 5, 2015 at 3:40 am #483055
Hello. Looking to customize the message that is emailed out via the contact form.
Request 1: I”d like to see “Dear [First Name] [Last Name],” above the message body. Right now, nothing is returned. I had it returning something before, but had the same issues as seen in this post. My current code is listed below.
function modify_autorespondermessage_func($message) {
$new_message = “Dear “.$_POST[‘avia_first_name_1’].” “.$_POST[‘avia_last_name_1’].”<br><br>”;
$new_message .= $message;return $new_message;
}
add_filter(‘avf_form_autorespondermessage’, ‘modify_autorespondermessage_func’, 10, 1);Request 2: Client wants to see “Thank You for your inquiry!” for the subject of the email that is sent out via the contact form. Right now I’m seeing “Thank you for your Message!” and I can’t see where to change it. I know it’s being picky on their part, but a future client want this to be extremely specific per each form.
Thank you,
RyanAugust 6, 2015 at 9:03 am #483743I’m having the same problem as request 2. I can change the subject in the contact form settings, but it still sends out “Thank you for your message!” no matter what i type or if I leave it blank.
August 6, 2015 at 2:35 pm #483885Finally found a solution to #2. I added the following to my Enfold Child Theme’s functions.php.
/*
* Changes the Subject Line of the Enfold Contact Form’s autoresponse.
*/
add_filter( ‘avia_contact_form_args’, ‘enfold_customization_autoresponsder’, 10, 1);
function enfold_customization_autoresponsder( $form_args ) {
$form_args[‘autoresponder_subject’] = ‘Thank You for your inquiry!’;
return $form_args;
}August 6, 2015 at 3:05 pm #483910Request 1
Getting VERY close. It looks like someone helped out a bit overnight. Currently, the autoresponder is showing “Dear JohnSmith”. I can’t figure out how to add in the “:” and the space between the first and last name…without breaking the functions.php
Top Wish: For the autoresponder to show “Dear: John Smith”
Acceptable Wish: For the autoresponder to show “Dear John Smith”
Thank you,
Ryan- This reply was modified 9 years, 4 months ago by WP Turned UP.
August 6, 2015 at 3:30 pm #483945Hell Yeah! After some more research, my Top Wish is granted! I think this will help a lot of other folks out there.
Contact Form
Within your contact form, create a First Name field and a Last Name field.Add the following to your Enfold Child Theme functions.php
/*
* Using the Enfold Contact Form autoresponder, this will output the First and Last name of the person filling out the contact form.
*/
function modify_autorespondermessage_func($message) {
$new_message = “Dear: ” . $_POST[‘avia_first_name_1’]. str_repeat(” “, 1). $_POST[‘avia_last_name_1’].”<br>”;
$new_message .= $message;return $new_message;
}
add_filter(‘avf_form_autorespondermessage’, ‘modify_autorespondermessage_func’, 10, 1);Output will be:“Dear: First Name Last Name” (Dear: John Smith)
- This reply was modified 9 years, 4 months ago by WP Turned UP.
August 7, 2015 at 2:56 am #484254Hey!
Glad you managed to sort it out, let us know if you have any additional questions.
Cheers!
JosueAugust 7, 2015 at 8:19 am #484325Great job working that out Ryan!
Changing the subject line in the autoresponse, should still be possible without adding to the theme, since it’s an option in the contact form settings.
August 7, 2015 at 11:53 am #484462January 30, 2019 at 5:28 pm #1060558Hello!
I am trying to get this to work with small variation: only surname (and in Dutch). I use the following code (thanks to WP turned up):
function modify_autorespondermessage_func($message) { $new_message = "Geachte heer/mevrouw " . $_POST[‘avia_Name_1’]. "<br>"; $new_message .= $message; return $new_message; } add_filter(‘avf_form_autorespondermessage’, ‘modify_autorespondermessage_func’, 10, 1);
But I can’t get it to work. I tried name (no caps), Naam and naam (Dutch for name as the field names are in Dutch in my version) but to no avail.
Clearly I am doing something wrong. The question is: what? :-)February 1, 2019 at 5:48 pm #1061637Dear Kriesi team,
Is there someone of you who can shed some light on this matter?
I added my question to this thread as it seams related, but if you want me to open another thread , please let me knowBest!
JanFebruary 1, 2019 at 7:02 pm #1061670Hi Jan,
Where are you adding the code?
Should this be like this?
$_POST[‘avia_name_1’]
https://kriesi.at/support/topic/add-custom-name-to-contact-form-autoresponder/#post-467225
Can you give us temporary admin access to your website in the private content box below, so that we can have a closer look?
Best regards,
VictoriaFebruary 1, 2019 at 7:42 pm #1061690Hi Victoria,
As I mentioned I also tested it with lower caps (avia_name_1). To be sure I just tested it again and the result is the same: the name is not added
I am adding the code to the functions.php in the child theme.
Please see the private section for the credentials
Best regards,
JanFebruary 3, 2019 at 5:14 pm #1062297Hi Jan,
Thank you, though credentials did not work for me. Could you please update the credentials?
Best regards,
VictoriaFebruary 4, 2019 at 12:52 pm #1062648This reply has been marked as private.February 5, 2019 at 8:46 pm #1063307Hi Jan_FtFA,
Best regards,
VictoriaFebruary 6, 2019 at 11:18 am #1063558This reply has been marked as private.February 8, 2019 at 4:45 pm #1064640Hi Jan_FtFA,
https://cl.ly/b9e97e340098 The message was not empty. My message was in private.
Please check.
Best regards,
Victoria- This reply was modified 5 years, 10 months ago by Victoria.
February 12, 2019 at 9:47 pm #1066105This reply has been marked as private.February 14, 2019 at 1:53 pm #1066961Hi Jan,
I still cannot login. I’ll ask my colleagues to check.
Best regards,
VictoriaFebruary 15, 2019 at 3:53 am #1067251Hi,
I was able to login, and found that you had some “curly quotes” in your code. I removed, please try now.Best regards,
MikeFebruary 21, 2019 at 3:23 pm #1069968Hi Mike,
Thanks for looking into this matter. Together with your “curly” corrections I worked it out. The field name is: avia_5_1For those interested, the correct code is:
function modify_autorespondermessage_func($message) { $new_message = "Geachte heer/mevrouw " . $_POST['avia_5_1']. ",<br><br>"; $new_message .= $message; return $new_message; } add_filter('avf_form_autorespondermessage', 'modify_autorespondermessage_func', 10, 1);
Note: In my case the var name is ‘avia_5_1’. Obviously this can be different for other forms. You can check the correct name with your browser dev tool
Best regards,
Jan- This reply was modified 5 years, 10 months ago by Jan_FtFA.
February 22, 2019 at 1:30 am #1070152Hi,
Glad to hear, thanks for using Enfold.
For your information, you can take a look at Enfold documentation here
For any other questions or issues, feel free to start new threads under Enfold sub forum and we will gladly try to help you :)Best regards,
Mike -
AuthorPosts
- You must be logged in to reply to this topic.