Description : Notify all WordPress users (and not only the admin) on post publishing.
The notification is sent only one time after the first post
publishing(not on every update).
I would suggest editing the pnfa_get_users function to something like the following. This will make it work with Multi-Site blog servers. It uses the wordpress function get_users_of_blog
function pnfa_get_users () { $blog_users = array(); global $wpdb; $users = get_users_of_blog(); foreach($users as $user) { $object = new stdClass(); $object->ID = $user->ID; $object->user_login = $user->user_login; $object->display_name = $user->display_name; $object->user_email = $user->user_email; $blog_users[$user->ID]=$object; } return $blog_users; }
Yianni Manager of Web Technologies, Instructional Technology Group Yale University ioannis.yessios@yale.edu
I have updated two places in your code. 1) the function for getting the blogs user list. 2) I use the plugin's get user list function to generate the list of e-mails instead of another query.
These changes are necessary, because otherwise, your plugin will send e-mail to absolutely everyone within a multi-site database, not just the users of a particular blog.
I have tested this code on both a mulit-site and single blog install.
-------------code--------------- pnfa_get_users should be:
function pnfa_get_users () { $blog_users = array(); global $wpdb; $query = "SELECT DISTINCT ID, user_login, display_name, user_email, meta_value FROM $wpdb->users, $wpdb->usermeta WHERE ID = user_id AND $wpdb->usermeta.meta_key = '{$wpdb->prefix}capabilities'"; $users = $wpdb->get_results($query); foreach($users as $user) { if ( count( unserialize( $user->meta_value ) ) > 0 ) { $object = new stdClass(); $object->ID = $user->ID; $object->user_login = $user->user_login; $object->display_name = $user->display_name; $object->user_email = $user->user_email; $blog_users[$user->ID]=$object; } } return $blog_users; }
----- your line 92 needs to be
$users = pnfa_get_users();
The previous code I commented on was still causing problems.
Ioannis Yessios Manager of Web Technologies, Instructional Design Group Yale University ioannis.yessios@yale.edu
Hi, I've installed both your Post and Comment notifiers on my site with the exact same settings and while the Comment emails are being sent out perfectly, the new Post emails are not! Do you have any idea what might be wrong? Thank you, Matthew
I've just tested them and they seem to work May be it's a conflict with another plugin, in a website test, try to disactivate all the other plugins then test, if it's ok, activate your plugin one by one with testing to know the culprit
Well that was weird. I followed your advice and deactivated all the other plugins and it worked! Then, after turning each one on until they were all on again...it still worked! Thanks! Matthew
Hi Fayçal! very nice plugin! simple and just does what it is supposed to. i was wondering if there is any possibility to add the post category to the mail notification? tried to figure it out myself but i failed. can you help?
Hi to exclude some categories: - Go to the file wp-posy-notifier-for-all.php in the plugin folder of your wordpress - Locate the line 78 http://plugins.trac.wordpress.org/browser/wp-post-notifier-for-all/trunk/wp-post-notifier-for-all.php - After this line, add the following code http://pastebin.com/ZEmLkMuc - Replace example slugs with yours in the line $excluded_categories = array ('cat-slug-1', 'cat-slug-2'); Regards
Hi, I installed and activated WP Post Notifier For All. Since there are no Settings, I guess I just expected it to start sending email to all registered users whenever I posted. I have posted several times since then, but have not received any email.
Is there something else that needs to be done? I am currently restricted to Wordpress 3.0 by virtue of a laggard web site host :(.
Hi Fayçal! Thanks for this plugin! I couldn't find anywhere to turn off notification for the "sender"; (i.e., if I post, a notification is sent to everyone, including me... Is there a way to exclude (turn notifications off just for) the "sender" ?
I tried and looked in all the settings, but couldn't find. can you help please?
Your Plugin is ok for me, but I've a question. Why, with the V 2.4, "Excluding post owner from notification" ? It was very convenient. Why have it removed ?
Best regards Alain RONK My website : www.modelisme-racer.fr
A new v2.6 is now available in what you can choose to exclude or not the post owner from notification (with the v2.4, the post owner was excluded by default in code)
I hope all is well. I have been looking for a plugin that has been tested with my wordpress template and I'm happy that I find this one! My template is the Business Lite and not many plugins have been tested.
Anyway, I installed your plugin "WP Post Notifier For All" and it works. Thanks! However, the html code for the picture displays in the email. I could forward you the email if you like. Can you please let me know if there is a way to not show the html code of the picture?
Hi, Thank your for this amazing plug-in, the issue that I am facing right now is the hosting company. They say this plug in sent mails to all users at the same time and this is consider as an abuse ( for them :p ), so they asked for a plug in that doesn't send a large number of mails at the same time.
is there is a way to queue mails while sending notifications? e.g: 30 mail per hour.
Hi, since last update (I think) I have problems with umlauts in mail body and test-changed line 145 from $message .= html_entity_decode($email_pnfa_body); to $message .= html_entity_decode($email_pnfa_body, ENT_QUOTES, "UTF-8");
Seems to work now. But I´m no expert and unsure, if this is the right way....
Hello, thanks for your plugin! I used to translate your plugin in French for my users and I also translate the admin panel options. I don't understand what means "strip email content tags"...
Friend, i don't know why, the e-mails stop to be sended. Do you know any issue or plugin conflict?
ReplyDeleteCan you update your great plugin, PLEASE!
Thanks! :)
I would suggest editing the pnfa_get_users function to something like the following. This will make it work with Multi-Site blog servers. It uses the wordpress function get_users_of_blog
ReplyDeletefunction pnfa_get_users () {
$blog_users = array();
global $wpdb;
$users = get_users_of_blog();
foreach($users as $user) {
$object = new stdClass();
$object->ID = $user->ID;
$object->user_login = $user->user_login;
$object->display_name = $user->display_name;
$object->user_email = $user->user_email;
$blog_users[$user->ID]=$object;
}
return $blog_users;
}
Yianni
Manager of Web Technologies, Instructional Technology Group
Yale University
ioannis.yessios@yale.edu
I have updated two places in your code. 1) the function for getting the blogs user list. 2) I use the plugin's get user list function to generate the list of e-mails instead of another query.
ReplyDeleteThese changes are necessary, because otherwise, your plugin will send e-mail to absolutely everyone within a multi-site database, not just the users of a particular blog.
I have tested this code on both a mulit-site and single blog install.
-------------code---------------
pnfa_get_users should be:
function pnfa_get_users () {
$blog_users = array();
global $wpdb;
$query = "SELECT DISTINCT ID, user_login, display_name, user_email, meta_value
FROM $wpdb->users, $wpdb->usermeta
WHERE ID = user_id AND $wpdb->usermeta.meta_key = '{$wpdb->prefix}capabilities'";
$users = $wpdb->get_results($query);
foreach($users as $user) {
if ( count( unserialize( $user->meta_value ) ) > 0 ) {
$object = new stdClass();
$object->ID = $user->ID;
$object->user_login = $user->user_login;
$object->display_name = $user->display_name;
$object->user_email = $user->user_email;
$blog_users[$user->ID]=$object;
}
}
return $blog_users;
}
-----
your line 92 needs to be
$users = pnfa_get_users();
The previous code I commented on was still causing problems.
Ioannis Yessios
Manager of Web Technologies, Instructional Design Group
Yale University
ioannis.yessios@yale.edu
Hey,
ReplyDeleteI quickly translated it in French.
See on WP : http://wordpress.org/support/topic/527937
Sorry for being late, a new version is now available
ReplyDeletehttp://wordpress.org/extend/plugins/wp-post-notifier-for-all/
Hi,
ReplyDeleteThx for this modules!
But It's possible to have this 2 little options:
1 - possible to send mail in Text format (not in html)
2 - possible to have a link in the mail, to direct unsubscribe email notifcation?
Thanks in advance and good job!
thx jauphrwa for the french transalation too.
Is there a way to get the plugin to recognize custom post types?
ReplyDeleteThis comment has been removed by the author.
ReplyDeleteSince the latest update I have the problem, that the e-mails sent included html code insteat just the text.
ReplyDeleteI could send you an example if you like
Could you help?
Kind regards
Hansjörg
I have the same problem. Emails appear to be correct on iphone/ipad but give code within outlook.
ReplyDeleteA new fix for this issue is now available.
ReplyDeleteThanks for your feedback.
Perfect. Thank you very mauch!!!
ReplyDeleteYour plug-in is sending emails to fast for the server we are using. Is it possible to slow down the rate at which emails are sent?
ReplyDeleteHi, I've installed both your Post and Comment notifiers on my site with the exact same settings and while the Comment emails are being sent out perfectly, the new Post emails are not! Do you have any idea what might be wrong?
ReplyDeleteThank you,
Matthew
I've just tested them and they seem to work
ReplyDeleteMay be it's a conflict with another plugin, in a website test, try to disactivate all the other plugins then test, if it's ok, activate your plugin one by one with testing to know the culprit
Well that was weird. I followed your advice and deactivated all the other plugins and it worked! Then, after turning each one on until they were all on again...it still worked!
ReplyDeleteThanks!
Matthew
I installed this plugin on my own hosted Wordpress blog and no emails get sent out. Does this plugin only work on Wordpress.com?
ReplyDeleteNo this plugin was done for hosted wordpress.
ReplyDeleteHi Fayçal!
ReplyDeletevery nice plugin! simple and just does what it is supposed to.
i was wondering if there is any possibility to add the post category to the mail notification?
tried to figure it out myself but i failed.
can you help?
Hi mahnuh
ReplyDeleteA new update is now available taking into account your request
Hi. Thank you for the plugin.:)
ReplyDeleteIs there a way to exclude some user categories from getting emails?
Hi
ReplyDeleteto exclude some categories:
- Go to the file wp-posy-notifier-for-all.php in the plugin folder of your wordpress
- Locate the line 78 http://plugins.trac.wordpress.org/browser/wp-post-notifier-for-all/trunk/wp-post-notifier-for-all.php
- After this line, add the following code http://pastebin.com/ZEmLkMuc
- Replace example slugs with yours in the line $excluded_categories = array ('cat-slug-1', 'cat-slug-2');
Regards
Hi,
ReplyDeleteI installed and activated WP Post Notifier For All. Since there are no Settings, I guess I just expected it to start sending email to all registered users whenever I posted. I have posted several times since then, but have not received any email.
Is there something else that needs to be done? I am currently restricted to Wordpress 3.0 by virtue of a laggard web site host :(.
Thanks for any insight
The plugin has a settings link named "Post Notifier", one under "Settings" and one under "Users", check it in the first screenshot.
ReplyDeleteHi,
ReplyDeleteAre there any possibility to include also the post content in teh mail?
Thank you
Hi Fayçal!
ReplyDeleteThanks for this plugin!
I couldn't find anywhere to turn off notification for the "sender"; (i.e., if I post, a notification is sent to everyone, including me...
Is there a way to exclude (turn notifications off just for) the "sender" ?
I tried and looked in all the settings, but couldn't find.
can you help please?
A new version is now available that excludes the post owner from the notification and also offers to include the whole post content in the email body
ReplyDeleteHello,
ReplyDeleteYour Plugin is ok for me, but I've a question. Why, with the V 2.4, "Excluding post owner from notification" ?
It was very convenient. Why have it removed ?
Best regards
Alain RONK
My website : www.modelisme-racer.fr
A new v2.6 is now available in what you can choose to exclude or not the post owner from notification (with the v2.4, the post owner was excluded by default in code)
ReplyDeleteHello Fay :)
ReplyDeleteYou are very professional, the update is very good for me !
Thank you very much, thank you !!!
Best regards
Alain RONK
My website : www.modelisme-racer.fr
This comment has been removed by a blog administrator.
ReplyDeleteThis comment has been removed by the author.
ReplyDeleteHello,
ReplyDeleteI hope all is well. I have been looking for a plugin that has been tested with my wordpress template and I'm happy that I find this one! My template is the Business Lite and not many plugins have been tested.
Anyway, I installed your plugin "WP Post Notifier For All" and it works. Thanks! However, the html code for the picture displays in the email. I could forward you the email if you like. Can you please let me know if there is a way to not show the html code of the picture?
Thank you for your help.
Angela
Hi
ReplyDeleteA new update is now available
Kind regards
Hi,
ReplyDeleteThank your for this amazing plug-in, the issue that I am facing right now is the hosting company. They say this plug in sent mails to all users at the same time and this is consider as an abuse ( for them :p ), so they asked for a plug in that doesn't send a large number of mails at the same time.
is there is a way to queue mails while sending notifications? e.g: 30 mail per hour.
Thanks a again : )
Hi,
ReplyDeletesince last update (I think) I have problems with umlauts in mail body and test-changed line 145 from
$message .= html_entity_decode($email_pnfa_body);
to
$message .= html_entity_decode($email_pnfa_body, ENT_QUOTES, "UTF-8");
Seems to work now. But I´m no expert and unsure, if this is the right way....
Hello, thanks for your plugin!
ReplyDeleteI used to translate your plugin in French for my users and I also translate the admin panel options. I don't understand what means "strip email content tags"...
Bonjour
ReplyDeletepour moi c'est "Supprimer les balises HTML du contenu de l'email"