• Hi

    There is a plugin that lets you mark posts as favorite http://wordpress.org/extend/plugins/wp-favorite-posts/, the thing is that I want to be able to email this list to the website owner using gravity form.

    Others have wrote that you can use this code but it’s not working

    Here is another post where they are trying to solve this issue http://wordpress.org/support/topic/plugin-wp-favorite-posts-mailing-favourite-list-to-site-owner?replies=22

    <?php 
    
    // Get an array containing the favorite post ID's:
    
    $favs = wpfp_get_users_favorites();
    
    // Use the ID's in the array to get the post titles. Construct a string with the titles of the favorited posts:
    
    $message = "Here are your favorite posts:\n";
    
    foreach ( array_keys($favs) as $favID) {
     $message .= get_the_title($favID) . "\n";
    }
    
    // Create array of values to pass on to the form embed function. Map $message to 'message_body' parameter selected earlier in the form editor
    
    $field_values = array ( 'message_body' => $message);
    
    // Embed the form with the $field_values array pre-populating it. 
    
    gravity_forms( 1, true, true, false, $field_values, true);
    
    ?>

    Can some help me out to make this actually work?

Viewing 2 replies - 1 through 2 (of 2 total)
  • It was mentioned on the other thread to take the s off of gravity_forms, to read:
    gravity_form( 1, true, true, false, $field_values, true);

    It is not working for me as well though: it lists random posts in the form, rather than the actual favourites list.

    Has anyone had success?

    Also, I added <?php wpfp_list_favorite_posts(); ?> in the template above the form code, and the favourites list appears on the page correctly.

Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘Email WP post favorite – please help’ is closed to new replies.