WordPress.org

Ready to get started?Download WordPress

Forums

Subscribe2
[resolved] notifications to all Admins (21 posts)

  1. 3cstudio
    Member
    Posted 12 months ago #

    I have admin User rights for myself as well as for the main site admin at my client's office. I get all the notifications, such as:

    joepublic@usa.net subscribed to email notifications!

    the same as she does, only I don't wish to. :) Can that function be turned off for some Admins and not for others?

    http://wordpress.org/extend/plugins/subscribe2/

  2. mattyrob
    Member
    Plugin Author

    Posted 12 months ago #

    @3cstudio,

    You can turn this off for all admins or leave it on. There is currently no way to filter the admin users who get the email.

    To change the setting go to Subscribe2->Settings and in the Email Settings tab change the settings where it says "Send Admins notifications for new" and remember to click submit.

  3. 3cstudio
    Member
    Posted 12 months ago #

    OK, mattyrob -- all set. Thanks!

    Might be a nice future feature to be able to assign only certain admins to receive those notifications, or not that simple?

  4. mattyrob
    Member
    Plugin Author

    Posted 12 months ago #

    @3cstudio,

    Sadly, not that simple. I might be able to add an API filter so that the list of admin email addresses can be filtered and amended immediately prior to sending. Would that be useful?

  5. 3cstudio
    Member
    Posted 12 months ago #

    No, don't go to great lengths, by any means... turning off notifications for all Admins will definitely suffice. I was just checking... thanks!

  6. mattyrob
    Member
    Plugin Author

    Posted 12 months ago #

    @3cstudio,

    Adding a filter really isn't that difficult for me. It allows end users to write a little code for their own sites and make the plugin perform as they want in certain respects. Much the same way the WordPress allows this to happen and plugins like Subscribe2 are the result.

  7. 3cstudio
    Member
    Posted 12 months ago #

    I'm far from a coder/developer, but I'm happy to try something if you are willing to work it into Subscribe2... I know enough to get me into trouble -- and enough WP friends to then get me out of it. ;-)

  8. mattyrob
    Member
    Plugin Author

    Posted 12 months ago #

    @3cstudio,

    I've just check in a change to the code. :)

    Grab this file:
    http://plugins.svn.wordpress.org/subscribe2/trunk/classes/class-s2-frontend.php

    And update the file of the same name on your server.

    Then create a little plugin like this:

    function my_admin_filter($recipients = array(), $email) {
    	// $recipients is an array of admin email addresses
    	// $email will be 'subscribe' or 'unsubscribe'
    	if ($email == 'subscribe') {
    		foreach ($recipients as $key => $email) {
    			if ( $email == 'me@mail.com') {
    				unset($recipients[$key]);
    			}
    		}
    	}
    }
    add_filter('s2_admin_email', 'my_admin_filter', 10, 2);
  9. 3cstudio
    Member
    Posted 12 months ago #

    whoa... very nice. I'll take a stab at it and let you know how it goes. Thanks again!

  10. mattyrob
    Member
    Plugin Author

    Posted 11 months ago #

    @3cstudio,

    I got around to testing this code - doesn't quite work as I missed returning the altered variable, the following works fine for me:

    function my_admin_filter($recipients = array(), $email) {
    	// $recipients is an array of admin email addresses
    	// $email will be 'subscribe' or 'unsubscribe'
    	if ($email == 'subscribe') {
    		foreach ($recipients as $key => $email) {
    			if ( $email == 'me@mail.com') {
    				unset($recipients[$key]);
    			}
    		}
    	}
    	return $recipients;
    }
    add_filter('s2_admin_email', 'my_admin_filter', 10, 2);
  11. 3cstudio
    Member
    Posted 11 months ago #

    Ah, thanks for the heads-up -- I may not respond for a few days, but will tackle this when a redev. is launched successfully and I have a few minutes to throw at this fine feature update. :)

    Thanks again!

    Steve C.
    3Cstudio

  12. 3cstudio
    Member
    Posted 11 months ago #

    OK, back to working into this today -- got a side issue:

    The Subject is not working...

    Subject: [Poppy Fields Studio] TITLE

    Where/How should the TITLE be properly fed to the Subject field? I couldn't find it in Settings, nor in other Support requests...

  13. mattyrob
    Member
    Plugin Author

    Posted 11 months ago #

    Steve,

    TITLE is a keyword and therefore needs to be contained in curly brackets {}.

  14. 3cstudio
    Member
    Posted 11 months ago #

    OK, in: Subscribe2 > Settings > Templates, I see:

    [{BLOGNAME}] TITLE

    for the Subject: line now.... That is what it defaulted to -- shouldn't the default have been {TITLE}, or no?

    Just curious -- thanks for clearing that up for me, and wondered if you could consider making that in brackets "out of the box" on the next iteration.

    Thanks for the info! I'll get back to you on what I originally inquired about at the start of this post. :)

    Steve C.
    3Cstudio

  15. mattyrob
    Member
    Plugin Author

    Posted 11 months ago #

    @Steve,

    You are quite right, there is an issue in the default settings. I'll fix that for the next release. Default should be:

    [{BLOGNAME}] {TITLE}

  16. 3cstudio
    Member
    Posted 11 months ago #

    Got it.

    I also have added the 2 edits you suggested earlier. The functions.php file now contains the my_admin_filter and I overwrote the class-s2-frontend.php file you referred me to. We'll see how it goes!

    Thanks,

    Steve C.
    3Cstudio

  17. 3cstudio
    Member
    Posted 11 months ago #

    So, where does the admin change manifest itself when these 2 edits are implemented? I have 1 blog that isn't sending me updates anymore, while the other still does... not sure what to instruct the Post-er to do or not-do. Can you give me insight as to what now happens when a new Post is made and how/where this filter comes into play?

  18. mattyrob
    Member
    Plugin Author

    Posted 11 months ago #

    @Steve,

    This filter only gets used when a emails are sent to admins after an end user confirms their subscription. It should not have any impact at all on post notification emails.

  19. 3cstudio
    Member
    Posted 11 months ago #

    Understood. What if only 1 admin would like to know that a new post has been sent out? For instance, I get notifications of the blogger that state:

    "Joe Public has posted a new item, '5 Tips to Grilling'"

    Is that a function that can also be sent per admin, or is it locked into sending to all admins without some heavier lifting from a coding standpoint?

  20. mattyrob
    Member
    Plugin Author

    Posted 11 months ago #

    @Steve,

    Each admin account will be classified in Subscribe2 as a Registered User. They will only get such emails while they have an active subscription. By that I mean they are subscribed to some categories. So, to stop the emails you need to go to Subscribe2->Subscribers and then the Registered Subscribers tab, find the admin user(s) and click edit below their email address. Then uncheck all categories to stop emails for new posts going to those users.

  21. 3cstudio
    Member
    Posted 11 months ago #

    Ah, thanks! I was not going to the Reg. Subscribers (not enough clicks-in)... Much appreciated.

    S

Reply

You must log in to post.

About this Plugin

About this Topic