I set cookie for my users to know from which source they come to the site and I want when user contact us their message comes with their cookie as well.
So that I created a new shortcode and added in mail section but it mails direct shortcode not its returned value
Code :
function my_shortcode( $atts ) {
return isset($_COOKIE['my_source']) ? $_COOKIE['my_source'] : '' ;
}
add_shortcode( 'my-source', 'my_shortcode' );
Message body in contact form 7 :
Name : [your-name]
Email : [your-email]
Phone : [form-tel]
My Source : [my-source]
Email I Received :
Name : Mohit Bumb
Email : [email protected]
Phone : 19191919191
My Source : [my-source]