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.

Dynamically Populating a form to send an email to the Post Author's email

  1. pjeaje
    Member

    I'm not happy GF won't explain how to do this a bit more clearly for newbies (http://www.gravityhelp.com/forums/topic/dynamically-populating-a-form-to-send-an-email-the-post-author) so I'm here asking for a favour...

    Hi, I want a simple content form in my sidebar of each post that will send the form to the author of the post. I also want the subject line of the email to contain the post title.

    I've read the link below but i am literally none the wiser...
    http://www.gravityhelp.com/documentation/page/Dynamically_Populating_the_Post_Author

    I can easily paste the code into my functions.php but then what? How do i make up the actual new form?

    Sorry but what I need is a "omg this guy is dumb" step by step instructions, maybe a video would be the go?

    I'm happy to give my admin login details if someone wants to set me up... i'm good at backward engineering to then work it out myself.

    thanks heaps,
    Pete

    Posted 9 years ago on Thursday February 2, 2012 | Permalink
  2. @pjeaje - please send me your login details and I will help you out. Thanks.

    chris@rocketgenius.com

    Posted 9 years ago on Tuesday February 7, 2012 | Permalink
  3. @pjeaje I emailed this information to you as well.

    You have a few more issues than I can help you with in email. I can pinpoint a couple problems though.

    1. You need to upgrade Gravity Forms. There was a bug in 1.6.2 which failed to correctly populate the usermeta information (like post author and post name). That might be the major source of your problem. None of the code would work without those merge tags populating correctly. After you upgrade, the user meta values (post author and email) will be populated correctly. Sorry about that bug, but it's fixed now.

    2. Your form is completely wrong. Very simply, it needs to be a contact form. So the visitor will fill in some amount of information you want to get. Get that configured first. Maybe it's just name, email, comments, maybe a phone number. That is what they will enter. DO NOT use the "Post" fields as you have done with the "Contact this business" form. That is wrong. The post fields are for CREATING posts on submission. You're not doing that.

    3. Then, be sure to set the Default Value on the Advanced tab. Use the drop down to insert this merge tag:

    {embed_post:post_title}

    That will ensure the contact form, when it's submitted, will have a record of the post title where the form was submitted from (so you know what business the inquiry is about.) I also made it "admin only" so it does not show to the user. They don't need to see it. But the submission will come to you with the information recorded properly in the entry.

    4. Once you have that all working in the form builder, we can go about adding another field to hold the post author's email, and then using that for the notification.

    I started a form for you called (GF) Contact Business and stuck that into a widget in the sidebar, so this should be working. You will need to get and configure the Widget Logic plugin to use the form on is_single() pages only. http://wordpress.org/extend/plugins/widget-logic/

    This part should be just about done. You can reconfigure or edit the form or create another one just like it. But this should get you on the right track with the easy stuff, and once that's done, we will work on functions.php and populating the author email address.

    Let me know when this part is working and then we will work on the rest. Thank you.

    Posted 9 years ago on Wednesday February 8, 2012 | Permalink

This topic has been resolved and has been closed to new replies.