Viewing 6 replies - 16 through 21 (of 21 total)
  • sepehr125

    (@sepehr125)

    Hi Verious,

    What do you want the output to be? If you want links to the favorite posts, you can replace get_the_title($favID) with get_permalink($favID).

    kofoe

    (@kofoe)

    ok maybe i have not understand it right!!
    The concept is:
    A user is adding posts to his favorites and this works great.. But what about sharing this list to hid/her friends? Is that possible (without users wordpress credentials of course…)

    sepehr125

    (@sepehr125)

    Well, this thread is about emailing the favorite’s list to the site’s owner/administrator. My solution (using GravityForms), allows for that. Sharing a list? I might try to construct a URL with the favorited post’s ID’s, like:

    https://www.yoursite.com/favorites?id1={First ID}&id2={Second ID}...

    Then create a page template that gets the ids from the URL and displays those posts. That URL can be emailed using a simple mailto link that would open up the user’s own email client.

    @sepehr125 or @verious.
    I use gravity forms and also the wp-favorite plugin and I would like to accomplish the same function as @verious. I tried to paste the snippet suggested by @sepehr125 into the functions.php but it threw error saying – ‘undefined function gavity_forms’ ?

    Would anyone explain the above coding in a simple step by step manner. As to what exactly goes into the template file, gravity form editor and functions.php respectively. I would really appreciate.

    Thanks in advance People!
    Cheers..

    First, I’d like to thank sepehr125 for sharing that piece of code but the code has a typo in the last line so it doesn’t work unless you changed gravity_forms with gravity_form so it should be;
    gravity_form( 1, true, true, false, $field_values, true);

    Second, the corrected code only displays the titles of some pages if you use get_the_title($favID) or the links of those pages if you use get_permalink($favID). The problem is none of them are actually favorited posts or pages. I don’t know according to what, the code gets those pages?
    So still, is there anybody who can alter that code so it actually pre-populates the form field with actual favorited post content?

    @southcast
    First duplicate a template file, change its name and add that above code under <?php the_content
    Then create your form as it’s suggested save it, use “message_body” as the parameter.
    I didn’t add anything to functions.php to make it work.
    just create a page where you want the form to appear and change the page template to your new duplicated template. You don’t need to add the form shortcode since you add the php version.

    @talha8877 The current code on my page-template is as below :

    <?php $favs = wpfp_get_users_favorites();
    	$message = "Here are your favorite posts:\n";
    	foreach ( array_keys($favs) as $favID) {
     	$message .= get_permalink($favID) . "\n";
    	}
    	$field_values = array ( 'message_body' => $message);
    	gravity_form( 16, true, true, false, $field_values, true);
          ?>

    It works but inside the gravity forms it only displays a single title and that is of the same page the form is embedded on, instead of selected posts. Any corrections please ?

Viewing 6 replies - 16 through 21 (of 21 total)
  • The topic ‘[Plugin: WP Favorite Posts] Mailing Favourite list to site owner’ is closed to new replies.