i'd like to create a shortcode that put in the email content a variable from a previous page submission, something like:
function add_product_title() {
$var=$_POST['red'] ;
return $var;
}
function register_shortcodes(){
add_shortcode('add_product_title', 'add_product_title');
}
add_filter( 'wpcf7_mail_components', 'register_shortcodes');
Placing [add_product_title] in the email container in the contact form 7 back office does not work ...
any idea?
what is the right filter to use?
what's wrong ?









