WordPress.org

Support

Support » Plugins and Hacks » Send an email to author when I add to favorites his post

Send an email to author when I add to favorites his post

Viewing 4 replies - 1 through 4 (of 4 total)
  • I have faced same problem.

    Yeah, It would be nice. Maybe next releases support this feature 🙂

    +1 This would be awesome to have. Maybe a hack could be fleshed out?

    For example this is what I’m using to fire off an email to an author letting them know that their post was published.

    //send email to author once entry is approved
    function _notifyContributers($post_id) {
       $post = get_post($post_id);
       $author = get_userdata($post->post_author);
    
       $message = "
          Hi ".$author->display_name.",\n
          Congratulations, your entry - ".$post->post_title." - has just been published.
       ";
       wp_mail($author->user_email, "Your image is now live on Videogame-art.com", $message);
    }
    add_action('publish_portfolio', '_notifyContributers');

    Ok so I was thinking, is there a way to combine the function I posted with the one below?

    function postfavorited(){
    	$postfavorited = get_post_meta(get_the_ID(), 'wpfp_favorites', true);
    	if($postfavorited != ''){
    		echo $postfavorited .' Favorited'; }
    		}
    	}

    Maybe remove the “if” statement? Might try this out.

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Send an email to author when I add to favorites his post’ is closed to new replies.