WordPress.org

Ready to get started?Download WordPress

Forums

WP Favorite Posts
Mailing Favourite list to site owner (22 posts)

  1. indezoo
    Member
    Posted 2 years ago #

    Can anyone help me add a feature i.e mailing the favorite list to the site owner with accepting user details.

    http://wordpress.org/extend/plugins/wp-favorite-posts/

  2. Verious B. Smith III
    Member
    Posted 2 years ago #

    I have been experimenting with this also and trying to enable mailing the favorite posts to a site administrator. I have tried some wacky things but to no avail. Is there a way to accomplish this?

  3. Verious B. Smith III
    Member
    Posted 2 years ago #

    Is this plugin under development? I would really like to know how it is possible to do this. I am currently trying to use gravity forms to implement it but I am stumped.

    What I have managed to do is find out that this information is stored in an variable that has an array in it called $favorite_post_ids

    From here I have no clue. Wish there was ome sort of documentation to help. :(

  4. Verious B. Smith III
    Member
    Posted 2 years ago #

    Can anyone please help with this issue???? I really need to understand How to do this for a client. I am at a loss and there seems to be no response or help.

    Someone?

  5. JorgenM
    Member
    Posted 2 years ago #

    think you are better helped with this plugin

  6. Verious B. Smith III
    Member
    Posted 2 years ago #

    I appreciate the suggestion. The plugin you listed is no longer supported. What I am building is not e- commerce but needs a "favorited" function/feature. I have invested quite a bit of time in this already and know that somehow it's possible if someone with more knowledge than myself were willing to help.

  7. aleksa_011
    Member
    Posted 2 years ago #

    Hi Verious B. Smith III.
    Did you find solution? I'm also trying to integrate that function, but with no luck.

  8. Verious B. Smith III
    Member
    Posted 2 years ago #

    No I have not found a solution to this yet and it's been grating on me. I am not sure but maybe we can put our heads together to figure it out then post it back here for future help. Are you on skype? My name is [ redacted ]

  9. iftomkins
    Member
    Posted 2 years ago #

    I'm also trying to email the favorites list! There are plugins that will email page/post content, but because it comes from the shortcode, it's not seen as content I guess, and I can't get it to work.

    Definitely keep me updated, and I will you!

  10. Verious B. Smith III
    Member
    Posted 2 years ago #

    @iftomkins will you skype me? We could figure it out together probably.

  11. iftomkins
    Member
    Posted 2 years ago #

    hi, i can't skype today, but how about tuesday? :)?

  12. Verious B. Smith III
    Member
    Posted 2 years ago #

    Looks like they redacted my skype name but tuesday would be fine. Email me at hello[at]philoveracity.com and we can have a meeting of the minds.

  13. solveigm
    Member
    Posted 1 year ago #

    Did anyone find a solution to this?

    I would really love for my visitors to be able to mail themselves their favourite list by using a simple form with Name, E-mail and a "Send me my favourites"-button.

    Additionally, it would be awesome if users could share their favorites with others. I suppose that would work fine with any social sharing plugin if every user's favourite page had a unique link, as in "www.domain.com/my_favourites/user".

    Any ideas on how to make that happen?

  14. sepehr125
    Member
    Posted 1 year ago #

    You can use the Gravity Forms plugin to prepopulate a message field with the favorite post. When you embed the form, you can pass an array to it containing values for each field. We will first construct that array ($field_values), then embed the form.

    In the form editor, add a Paragraph field for the message body. Go to the Advanced tab and check "Allow field to be populated dynamically". It will ask you for a Parameter Name. Type in something like "message_body".

    Now you can embed this form by calling the gravity_form() function directly from your template or by adding an action in your functions.php file. For simplicity I'll include something you can put in your template:

    <?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);
    
    ?>

    Hope that helps!

  15. Verious B. Smith III
    Member
    Posted 1 year ago #

    This is exactly why i <3 the WordPress Community! Thank you much @sepehr125.

    I am going to try to implement this solution and will get back here with an answer on how it is working out on the site in Question.

    Thanks again,

    ~Verious
    http://philoveracity.com

  16. Verious B. Smith III
    Member
    Posted 1 year ago #

    Okay so I have tried the above solution but it is only outputting page names in the message field.

  17. sepehr125
    Member
    Posted 1 year ago #

    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).

  18. kofoe
    Member
    Posted 1 year ago #

    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...)

  19. sepehr125
    Member
    Posted 1 year ago #

    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:

    http://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.

  20. southcast
    Member
    Posted 1 year ago #

    @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..

  21. talha8877
    Member
    Posted 1 year ago #

    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.

  22. southcast
    Member
    Posted 1 year ago #

    @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 ?

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic