Takayuki, modeled this off of your 'wpcf7_special_mail_tag' function in mail.php, and added it to my site-specific plugin. Seems to work like a charm -- and provides me with a way to continue adding special mail tags :)
add_filter( 'wpcf7_special_mail_tags', 'custom_mail_tag', 10, 3 );
function custom_mail_tag( $output, $name, $html ) {
$name = preg_replace( '/^wpcf7\./', '_', $name ); // for back-compat
$submission = WPCF7_Submission::get_instance();
if ( ! $submission ) {
return $output;
}
if ('_landingpage' == $name) {
$cookie_name = "landingPage";
if(!isset($_COOKIE[$cookie_name])) {
return 'Original page not retrievable.';
} else {
return $_COOKIE[$cookie_name];
}
}
return $output;
}
Let me know if anything looks like it could use improvement.
Thanks again !!