This is what I already got working after searching this wonderful forum.
/**
* Put form with ID 2 in single.php
*/
add_action( 'hybrid_after_entry', 'email_advertiser', 11);
function email_advertiser() {
if ( is_single() && in_category('Marketplace') ) {
gravity_form(2, false, false);
}
}
/**
* Change notifacation routing in order to attach post author emailadress to the form
*
*/
add_filter( 'gform_notification_email_2', 'route_notification', 10, 2 );
function route_notification($email_to, $entry){
global $post;
$email_to = get_the_author_email();
return $email_to;
}
Now what I want is to pre-populate the Subject field with Reaction to + the post title.
add_filter('gform_field_value_reactionsubject', 'populate_reactionsubject');
function populate_reactionsubject() {
global $post;
return ($post->post_title);
}
How do I put 'Reaction to' before post title? I tried to echo it, but that just makes it appear above the form.