Tagged: autoresponder, CONTACT FORM
-
AuthorPosts
-
November 13, 2017 at 9:38 am #876000
Dear Kriesi team,
I am currently using several contact forms. Some contain the field <Name> others contain the field <First Name>.
Is there a way to modify functions.php so that the auto response will contain “Dear <Name>,” or “Dear <First Name>,”
Both with a blank line before the message body?Is there a workaround if that is not easily achieved?
Thanks!
November 13, 2017 at 10:16 pm #876317Hey ofekw,
Here are the hooks / filters available which you can use to modify the forms
https://github.com/KriesiMedia/enfold-library/tree/master/actions%20and%20filters/ALB%20Elements/Contact%20FormCheck them, and you can create any type of function you need.
let us know if there is something else we can do for you
Best regards,
BasilisNovember 14, 2017 at 3:48 am #876412Hello Basilis,
Thanks for these links.What we are trying to achieve is pre-pending the “Dear <First Name>” without affecting the rest of the autoresponse message as defined in the page builder. i.e., each contact form will have its own custom message.
Can you help please?
November 16, 2017 at 3:56 am #877326Hi,
Please add the following filter in the functions.php file.
function avf_form_custom_autoresponder_mod( $out, $user_input, $contact_form, $contact_form_input ) { ob_start(); /** * Enter your HTML template or include one */ ?> <div> <h2>Thank you for contacting us.</h2> <p>We will answer your request as soon as possible.</p> <p>Best regards<br /> Your Enfold Support Team </p> </div> <?php $message = ob_get_contents(); ob_end_clean(); $out = $message . "<br/><br/><strong>Dear <" . $contact_form_input['1_1'] . "></strong><br/><br/>" . $out; return $out; } add_filter( 'avf_form_custom_autoresponder', 'avf_form_custom_autoresponder_mod', 10, 4 );
Change the HTML output as needed.
Best regards,
IsmaelNovember 17, 2017 at 6:13 am #877945Dear Ismael,
Thanks for your message.
This code replaces the content of ALL autoresponders. We only want to prep-end “Dear <First Name>” without affecting the rest of the message as defined in the page builder.
Can you help please?
Thanks!
ofekw
November 19, 2017 at 3:38 am #878701Thanks Ismael,
This code causes the body of the autoresponse messages to be “Dear ” and nothing else. I tried tweaking the code to $contact_form_input[‘avia_1_1’] because the name and ID of the field is actually “avia_1_1” but still no success.
Is there possibly some syntax or other error we are missing here?
Much appreciated,
ofekw
November 21, 2017 at 3:21 am #879461Hi,
Please post the login details in the private field. Or replace the code with the following.
function avf_form_custom_autoresponder_mod( $out, $user_input, $contact_form, $contact_form_input ) { $out = "<strong>Dear " . urldecode($contact_form_input['1_1']). "</strong><br/><br/>" . $contact_form->form_params['autoresponder']; return $out; } add_filter( 'avf_form_custom_autoresponder', 'avf_form_custom_autoresponder_mod', 10, 4 );
`
Best regards,
IsmaelNovember 22, 2017 at 4:35 am #880026Hello Ismael,
Thanks for following up.
Getting close now, this code gives us “Dear <first name>” but nothing else. It’s missing the rest of the autoresponder message as per each contact form.
Please advise.
Thanks!
ofekw
November 22, 2017 at 6:10 am #880078Hey!
Thank you for the update. We modified the fitler a bit. Please try it again and don’t forget to remove the browser cache before testing the contact form page. If it’s still not working, please post the FTP and WP login details in the private field so that we can test it.
Best regards,
IsmaelNovember 23, 2017 at 4:00 am #880581Hi Ismael,
Thanks for the update, this now works great when one word is entered in the <Name> or <First Name>fields. However it does not work properly when there is a space entered in the name string. For example, when using the name: “Ilan Wittenberg”, this is the email received:
Dear Ilan%20Wittenberg
without the autoresponder message.
1. Can the code display the entire string properly even when there is a space entered (plus the autoresponder message)?
2. Can you add a comma after the name please?
Thanks!
ofekwNovember 24, 2017 at 1:45 am #880992Hello Ismael,
You are welcome to test the auto responder by using the contact forms and see.
Have placed a few links below.
Please note that the first line of the autoresponder will contain “%20” if a space is entered in the <Name> string.
Thanks!
ofekwNovember 24, 2017 at 6:16 am #881067Hi,
We modified the code. Please try it again. Don’t forget to remove the browsre cache. Or post the login details in the private field so that we can test it.
Best regards,
IsmaelNovember 24, 2017 at 6:32 am #881074Hello Ismael,
Unfortunately there is no change from the previous test.
You are welcome to test the autoresponder message by entering a message in the contact forms links below. The message will be sent to your email and you can verify the resulting autoresponder issue.
All forms currently show %20 when there is a space in the first string.
The first link below does not show the autoresponder message in the email sent, the other two do. Not sure why the first contact form shows only: “Dear <name>…”
Thanks,
ofekw
November 26, 2017 at 12:26 am #881805Hi,
I’m not sure why it wouldn’t work for the other “contact” form if they have the same configuration. Please post the login details in the private field.
Best regards,
IsmaelNovember 26, 2017 at 12:46 am #881809This reply has been marked as private.November 26, 2017 at 1:14 am #881819Hi,
Thank you for the info. Please set the user role to admin so that we can modify the filter. Make sure that the Appearance > Editor panel is accessible.
Best regards,
IsmaelNovember 26, 2017 at 1:28 am #881821This reply has been marked as private.November 27, 2017 at 5:34 am #882099Hi,
Thank you for the update. The “autoresponder” parameter is empty in the contact page so we had to add it manually in the filter.
Best regards,
IsmaelNovember 28, 2017 at 9:56 am #882544Thanks for sorting this Ismael and also for resolving the %20 when space was used in the name!
Be great to have a comma after the <first name> if possible. For example: Dear Ismael,
Very much appreciated,
ofekw
November 30, 2017 at 1:17 pm #883400Hi,
In the filter, please look for this part.
"</strong><br><br>"
Just add the comma before the closing < / strong > tag.
",</strong><br><br>"
Best regards,
IsmaelNovember 8, 2018 at 6:41 am #1031124Hello Ismael,
There are a few contact forms on my website:
This Register form: http://ilanwittenberg.com/contact/ shows only the header line: “Dear <first Name>,” without the body of the Autorespond Text.
This Booking form: http://ilanwittenberg.com/booking/ works perfectly: header line + Autorespond Text.
These two forms are also good: http://ilanwittenberg.com/register/ and http://ilanwittenberg.com/be-in-to-winI cannot find any difference between them.
Please advise,
ofekw
November 12, 2018 at 5:35 am #1032429Hi,
Did you add any html tags to the custom autoresponder message? Please make sure that the tags are closed properly.
Best regards,
IsmaelNovember 12, 2018 at 5:51 am #1032434Thanks Ismael!
November 13, 2018 at 1:57 am #1032833 -
AuthorPosts
- The topic ‘Customising Autoresponder using multiple contact forms’ is closed to new replies.