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.

Automatically Submit Form to Post Author

  1. Just in case anyone's interested in this, I've figured out how to have a form automatically submit to the author of the post the page appears on.

    <?php
     $author_email_addy = get_the_author_meta( 'user_email' );
     gravity_form(
    3,
    $display_title=false,
    $display_description=true,
    $display_inactive=false,
    $field_values = array(
    'author_email'=> $author_email_addy
    ),
    $ajax=true
     ); ?>

    The3 is the ID of the form, FYI, and I'm doing this all via a function call, not using the shortcode / WP Post Editor.

    Note the 'author_email'=> $author_email_addy, this is the important part.

    1. Add an Email field (from the Advanced Fields in the Form Editor) to your form.
    2. Editing that field, click the Advanced tab
    3. Click Allow Field to be Populated Dynamically, and enter author_email as the value.
    4. Save the form and go to Notifications
    5. Scroll down and tick the box Notification to Users
    6. In the Send To: field, choose the Email field from step 1 above

    That's it!

    Posted 12 years ago on Tuesday December 20, 2011 | Permalink
  2. Thank you for posting that code Nathan.

    Posted 12 years ago on Wednesday December 21, 2011 | Permalink