WordPress.org

Support

Support » Plugins and Hacks » [Resolved] notifications to all Admins

[Resolved] notifications to all Admins

Viewing 15 replies - 1 through 15 (of 20 total)
  • @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.

    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?

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

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

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

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

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

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

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

    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

    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…

    Steve,

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

    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

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

    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

Viewing 15 replies - 1 through 15 (of 20 total)
  • The topic ‘[Resolved] notifications to all Admins’ is closed to new replies.