Tagged: contact form customisation
-
AuthorPosts
-
April 18, 2019 at 8:07 am #1092324
Hello Team,
Have previously been advised successfully by Ismael to add the following code to functions.php:
* Customising Autoresponder to start with Dear<first name>*/ function avf_form_custom_autoresponder_mod( $out, $user_input, $contact_form, $contact_form_input ) { $out = "Dear " . urldecode($contact_form_input['1_1']). ",<br/><br/>" . $contact_form->form_params['autoresponder']; return $out; } add_filter( 'avf_form_custom_autoresponder', 'avf_form_custom_autoresponder_mod', 10, 4 );
This code worked perfectly to send an Autoresponder starting with Dear <first name>,. However this code is now broken and the Autoresponder now shows “Dear ,” (missing the <first name> field). Perhaps this code had been changed in one of the recent Enfold updates?
Please advise,
ofekwApril 21, 2019 at 8:00 pm #1093116Hey ofekw,
We have not done any changes on our form at all. Have you filled the name properly?
Best regards,
BasilisApril 21, 2019 at 9:34 pm #1093147Hello Basilis,
Thanks for following up. There was no change to any of the contact forms layout, but there were changed to functions.php with code added after the one showing above. Also, a contact form plugin was installed: Contact Form 7.
Could any of these changes cause the code to break? Can you refer this to Ismael please – this should be a quick fix…
Thanks!
ofekwApril 22, 2019 at 10:52 pm #1093429Hi,
The issue is this, please disable the contact form plugin so we can test if this works out properly
Best regards,
BasilisApril 23, 2019 at 1:45 am #1093455Hi Basilis,
Thanks for following up. Have disabled Contact Form 7 plugin. Please do let me know if you need admin rights.
Regards,
ofekw
April 24, 2019 at 8:15 pm #1094157Hi,
Has this been shorted out by disabling the Contact Form 7?
Best regards,
BasilisApril 24, 2019 at 9:46 pm #1094185Hi Basilis,
Thanks for following up,
No the autoresponder still does not show the <first name> field after deactivating Contact Form 7. Perhaps Ismael can look closer at this issue please?
Kind Regards,
ofekwApril 26, 2019 at 4:57 am #1094611Hi,
Did you enable the reCAPTCHA option? Please try to replace this line:
urldecode($contact_form_input['1_1']).
.. with:
urldecode($contact_form_input['1_2']).
Best regards,
IsmaelApril 26, 2019 at 5:43 am #1094615Hello Ismael,
Yes, have enabled Google reCAPTCHA v3 which stopped all spam!
Unfortunately changing that line of code did not make any difference, autoresponder email starts with “Dear ,” missing the field <first name>.
Any ideas?
Thanks,
ofekw
April 26, 2019 at 7:38 am #1094633Hi,
Glad to hear that the spam protection is working. For the current issue, please replace the “1_2” with “2_1”. That is the generic id of the “First Name” field.
urldecode($contact_form_input['2_1']).
Best regards,
IsmaelApril 26, 2019 at 7:59 am #1094639Hi Ismael,
Perfect!
Case closed.
Much appreciated,
ofekw
April 29, 2019 at 4:06 am #1095158Hi,
Awesome. Glad we could help!
Please take a moment to review our theme and show your support https://themeforest.net/downloads
Don’t forget to bookmark Enfold Documentation for future reference.Thank you for using Enfold :)
Best regards,
Ismael -
AuthorPosts
- You must be logged in to reply to this topic.