I am using custom form 7
I want that, If anyone clicks the mail button under single post in wordpress, it will automatically redirect him to contact-us page and then subject of the mail will be the post title.
How can I do that?
I am using custom form 7
I want that, If anyone clicks the mail button under single post in wordpress, it will automatically redirect him to contact-us page and then subject of the mail will be the post title.
How can I do that?
Comments are closed.
Haven’t used it before, but this plugin claims to work for your purposes: https://wordpress.org/plugins/contact-form-7-dynamic-text-extension/
You will then create your mail link to contain the post title via a query parameter with (maybe with http_build_str()), so that your URL becomes like:
After which you have to create the new CF7 tag as such, to auto-populate with the $_GET variable.
Solved with this code:
input field:
<input id="post-referer" value="<?php echo esc_attr($subject); ?>" type="hidden">
then used jQuery to fill up the subject field from ‘post-referer’ field’s value.
You need to install Contact Form 7 Dynamic Text Extension and use fields in your form this way.
CF7:
The
key
is the name of parameter of your url.