Tagged: CONTACT FORM, fields
-
AuthorPosts
-
February 23, 2016 at 1:05 pm #587680
Good morning!
We want to include the name of the person who contact us recovering the name field content that he has fill in the form and put this in the autoresponse text. Does exist any shortcode for recover data from the fills of the form?
Best regards,
SMS PRO
- This topic was modified 8 years, 10 months ago by SMSPRO_CENTRAL. Reason: notify me
February 25, 2016 at 12:05 pm #588964Hi,
The following code should do the work but you may need to change
avia_nombre_1
according to your form structure:function modify_autorespondermessage_func($message) { $new_message = "Dear". $_POST['avia_nombre_1']."<br>"; $new_message .= $message; return $new_message; } add_filter('avf_form_autorespondermessage', 'modify_autorespondermessage_func', 10, 1);
Can you post the link to your form page please?
Regards,
JosueFebruary 25, 2016 at 1:40 pm #589040Thanks Josue!
I understand that i have to introduce this code in functions.php changing the “avia_nombre_1” for “avia_nombre_y_apellidos_1”, according to this form http://smspro.es/contacto/ for example
function modify_autorespondermessage_func($message) { $new_message = "Dear". $_POST['avia_nombre_y_apellidos_1']."<br>"; $new_message .= $message; return $new_message; } add_filter('avf_form_autorespondermessage', 'modify_autorespondermessage_func', 10, 1);
Regards,
SmsProFebruary 25, 2016 at 2:03 pm #589066Correct, have you tested it? did it work?
February 26, 2016 at 7:02 pm #589941YESS! it works .. Thank you very much …
I added in the function urldecode() for space and accentsfunction modify_autorespondermessage_func($message) { $nom= urldecode($_POST['avia_nombre_y_apellidos_1']); $new_message = "Dear". $_nom."<br>"; $new_message .= $message; return $new_message; } add_filter('avf_form_autorespondermessage', 'modify_autorespondermessage_func', 10, 1);
Regards,
SmsProFebruary 27, 2016 at 1:07 am #590086You are welcome, glad to help :)
Regards,
JosueJune 10, 2016 at 1:45 pm #646194Hello again!
I would like you to ask how can i do the same with a more complex website in different languages, i would like to recover the fields in those languages independently and i am using the plugin Polylang. I want the autoresposive text in the appropriate language.
Let me know if you want to access to the website or anything!
Regards!
June 11, 2016 at 1:31 pm #646529Hi,
I think it would be more convenient to use a specialized form plugin like:
https://wordpress.org/plugins/contact-form-7/Best regards,
Josue -
AuthorPosts
- You must be logged in to reply to this topic.