Contact Form 7 custom shortcode
<p>I'm getting a little ahead of my php experience. Please help.</p>

<p>I am trying to create a custom shortcode for contact form 7 - using that plugins <a href="http://contactform7.com/2015/01/10/adding-a-custom-form-tag/" rel="nofollow">"developer cook book"</a></p>

<p>I want the shortcode to get the url (permalink) of the page the form is on
and then use this shortcode in the message body of the return email or that's to say the email notification to the business - and in this way the business will know which landing page this form was submitted from, since this form will be used on many landing pages.</p>

<p>here's the code I have thus far, in my <strong>functions.php</strong> file:</p>

<pre><code>add_action('wpcf7_init', 'custom_add_shortcode_lptitle');

function custom_add_shortcode_lptitle() {
    wpcf7_add_shortcode('lptitle', 'custom_lptitle_shortcode_handler'); // "lptitle" is the type of the form-tag
}

function custom_lptitle_shortcode_handler($tag) {
    global $post;
    $url = get_permalink($post-&gt;ID);
    return $url;
}
</code></pre>

<p>And then the shortcode I am using in the message body of the notification email is: Landing Page URL [lptitle]</p>