PLEASE NOTE: These forums are no longer utilized and are provided as an archive for informational purposes only. All support issues will be handled via email using our support ticket system. For more detailed information on this change, please see this blog post.

How to send postmeta data in form confirmation email?

  1. I'd like to attach a PDF to the confirmation email that's sent. That PDF is attached as post metadata to the post that includes the form (there is more than one post and each post has a different PDF).

    I've attached single files using gform_user_notification_attachments before, but I'm not sure how to get gravity forms to recognize which post it is on and attach the PDF for that post.

    Just to be clear, there is a post, with a file attached as metadata. There is a form on that post to request being sent a link to the file. The user submits an email address and gets a link to the file attached to the post they submitted there email address on.

    Posted 6 years ago on Saturday January 19, 2013 | Permalink
  2. So I figured out how to do this using a hidden field populated by a GF parameter. I'm just not sure it's the best way?

    I created a hidden field to by dynamically populated by a parameter called whitepaper_url

    Then I insert the form with code:

    <?php
    add_action('genesis_after_post_content', 'jb_whitepaper_form' );
    function jb_whitepaper_form() {
    	if ( 'jb_whitepaper' == get_post_type() ) {
    		$whitepaper_url = 	get_post_meta( get_the_id(), 'jb_whitepaper_url', true );
    		echo '<div class="whitepaper-form grey-box">';
    		gravity_form(2, true, true, false, array('whitepaper_url' => $whitepaper_url), false);
    		echo '</div><!-- end .whitepaper-form -->';
    	}
    }

    finally my confirmation looks like this

    Thanks!  Here is the link to download your white paper.
    <a href="{Whitepaper URL:2}" alt="PDF Download Link" title="Click or Right click and save as to download">{Whitepaper URL:2}</a>

    I need to do something similar on several other sites so I'm still interested if there is a another or better way?

    Posted 6 years ago on Sunday January 20, 2013 | Permalink
  3. Getting it into the entry is the easiest way to make sure it gets into the notification. I think your solution is fine.

    Posted 6 years ago on Monday January 28, 2013 | Permalink