Help finding second author in subscribe plugin
-
HI,
I love your plugin thank you!
The issue: i am no big programmer and i have incorporated in my site a plugin called “Wp-subscribe-author” that sends an email to users who “follow” an author.
The problem is that mails are sent only if you follow the first author, but if you follow only the second author, no mail will be sent…Any help wolud be nice. Here is the code of the plugin that i thing is relevant …
public function wpsa_notify_author_subscribers($post){ $wpsamodel =new Wpsa_Model(); $template =new Wpsa_Template(); $author_id = $post->post_author; $Author_name = get_the_author_meta('display_name',$author_id); if($wpsamodel->get_num_subscribers($author_id) != 0){ $subscribers = $wpsamodel->getAllSubscribers($author_id); foreach($subscribers as $subscriber){ $subscriber_id = $subscriber->subscriber_id; if($subscriber_id != 0 ){ $user = get_user_by('id',$subscriber_id); $subscriber_email = $user->user_email; } else{ $subscriber_email = $subscriber->subscriber_email; } $postMessage = ""; $param = array('post_id'=>$post->ID,'author_id'=>$author_id,'subscriber_email'=>$subscriber_email); $postMessage = $template->renderTemplate('default',$param); $parse = parse_url(get_option('siteurl')); $blog_host = $parse['host']; $headers = ''; $headers = "MIME-Version: 1.0" . "\r\n"; $headers .= "Content-type: text/html; charset=".get_bloginfo('charset')."" . "\r\n"; $headers .= "From: ".get_bloginfo('name')." <no-reply@".$blog_host.">" . "\r\n"; $subject ="New Post From $Author_name"; if(wp_mail($subscriber_email,$subject , $postMessage, $headers)){ //echo "sending success"; } else{ //echo "sending failed"; } } //end loop }
- The topic ‘Help finding second author in subscribe plugin’ is closed to new replies.