Add the last viewed post title to a contactform with shortcode [closed]

I think the best way to do this would be to use the Contact Form 7 Dynamic Text Extension, and then pre-populate the URL to the Contact Form page with the current post title. More details on how to do that in my answer here. The code to pre-populate the link in a post template would look something like:

<a href="https://wordpress.stackexchange.com/questions/34481/<?php echo get_page_link(58); ?>&foo=<?php single_post_title(); ?>">Contact Form</a>