WordPress.org

Ready to get started?Download WordPress

Forums

Email Users
Questions about Capabilities before I attempt to Install (19 posts)

  1. frank thirteen
    Member
    Posted 2 years ago #

    What is the difference between "registered blog users" (per the descriptive highlights about your plugin) and general users? I have a WP/BuddyPress site running and I need to reach all members of my BuddyPress site, which end up being all users in my WP install.

    Secondly, as Admin I am the only one that I want to be given the ability to email everyone. Is there a way to prevent users/members from sending broadcast emails?

    Thank you for the answers to these questions. It will help me determine if I can use your plugin.

    http://wordpress.org/extend/plugins/email-users/

  2. JKNN
    Member
    Posted 2 years ago #

    Searching answers to the same :)

  3. Mike Walsh
    Member
    Plugin Author

    Posted 2 years ago #

    This is the default set up capabilities as they appear in the plugin code:

    function mailusers_add_default_capabilities() {
    	$role = get_role('contributor');
    	$role->add_cap(MAILUSERS_EMAIL_SINGLE_USER_CAP);
    
    	$role = get_role('author');
    	$role->add_cap(MAILUSERS_EMAIL_SINGLE_USER_CAP);
    	$role->add_cap(MAILUSERS_EMAIL_MULTIPLE_USERS_CAP);
    
    	$role = get_role('editor');
    	$role->add_cap(MAILUSERS_NOTIFY_USERS_CAP);
    	$role->add_cap(MAILUSERS_EMAIL_SINGLE_USER_CAP);
    	$role->add_cap(MAILUSERS_EMAIL_MULTIPLE_USERS_CAP);
    	$role->add_cap(MAILUSERS_EMAIL_USER_GROUPS_CAP);
    
    	$role = get_role('administrator');
    	$role->add_cap(MAILUSERS_NOTIFY_USERS_CAP);
    	$role->add_cap(MAILUSERS_EMAIL_SINGLE_USER_CAP);
    	$role->add_cap(MAILUSERS_EMAIL_MULTIPLE_USERS_CAP);
    	$role->add_cap(MAILUSERS_EMAIL_USER_GROUPS_CAP);
    }

    There are four capabilities that the plugin defines, you can see them above. You could use a plugin such as Role Manager or Advanced Access Manager to remove the ability to use these capabilities from certain roles if desired.

  4. frank thirteen
    Member
    Posted 2 years ago #

    Thanks @MikeWalsh.

    Can you answer this for me please?

    What is the difference between "registered blog users" (per the descriptive highlights about your plugin) and general users? I have a WP/BuddyPress site running and I need to reach all members of my BuddyPress site, which end up being all users in my WP install.

  5. Mike Walsh
    Member
    Plugin Author

    Posted 2 years ago #

    For the Email Users plugin, a registered blog user is equivalent to the list of users you see when choosing the Users menu on the WordPress Dashboard. I don't know if BuddyPress uses the standard WordPress Users model or if it creates another one - if it uses the standard WordPress Users then it should work for you.

  6. frank thirteen
    Member
    Posted 2 years ago #

    Excellent. Thanks @MikeWalsh. I'll install and test. Then I'll post back here for @JKNN and anyone else interested in using your plug-in.

  7. frank thirteen
    Member
    Posted 2 years ago #

    Excellent plug-in @MikeWalsh. One question:

    What is the significance of setting all the "Email Users Settings" on the WordPress Settings > Email Users page?

    I tweaked things like "Sort Users By" and "Default Notification Subject" and "Default Notification Body"? And what is "User Settings Table Rows" used for?

    I went to Email Users > Send to User(s) and selected everyone in the textarea box and drafted and sent a broadcast message.

    It worked fine and all 200+ messages were delivered. Except none of the settings that I tweaked above seemed to come into play.

    Can you explain?

    Thanks. Awesome plug-in -- does exactly what I need it to do.

  8. Mike Walsh
    Member
    Plugin Author

    Posted 2 years ago #

    The "Email Users -> User Settings" page will let you control on a user by user basis which users can receive post notifications and bulk email. Since you just installed the plugin, the activation process will set every user to the default state but if you want to change all users or a large number of them, this is the way you'd do it. Each user also has the ability to change their settings on their own profile page.

    The table row settings lets you specify how many users are shown on each page when showing the User Settings. If you have a large number of users, it can be helpful to look at a lot of them at once.

  9. frank thirteen
    Member
    Posted 2 years ago #

    Ok, thanks @MikeWalsh -- I saw those settings, but I am talking about a different set of settings:

    WordPress Settings > Email Users page

    "Email Users Settings" Page

    • Sort Users By
    • Default Notification Subject
    • Default Notification Body
    • User Settings Table Rows
  10. Mike Walsh
    Member
    Plugin Author

    Posted 2 years ago #

    1. Sort Users By: How should the users be sorted when presented. By default it sorts by username but you can sort by first, last, or other combinations. I usually sort by last name and show the username in parentheses.
    2. Default Notification Subject: Default subject for Post Notifications. You can notify users of a new post on your blog using the Notify meta box on the post edit page.
    3. Default Notification Body: Default email content for post notifcations emails.
    4. User Settings Table Rows: Number of users to show per page on the User Settings page.

    Hope this helps.

  11. frank thirteen
    Member
    Posted 2 years ago #

    Oh, got it. Thanks @MikeWalsh.

  12. frank thirteen
    Member
    Posted 2 years ago #

    @MikeWalsh,

    I have another question. Where do you pull the "from" email address from? When I send messages to users I am getting a foreign email address (ie., one that is not setup anywhere in any of my WordPress, BuddyPress, or Email Users settings.

    It is causing many messages to land in junk & spam folders.

    Thanks.

  13. Mike Walsh
    Member
    Plugin Author

    Posted 2 years ago #

    By default it uses the email address for the WordPress user who is sending the email or notification. There is a setting which you can use to override the email address the plugin picks up from the user sending email, it is called "From Sender Email Address Override".

  14. frank thirteen
    Member
    Posted 2 years ago #

    That is so strange @MikeWalsh.

    The email address of the user sending is no where to be seen or found. The address on the From: line is "noreply@<some arbitrary reference to my server name>

    • It is not the email address of the logged-in and sending user -- which is "admin"
    • It is not the WP Network Admin Site Network Settings > Operational Settings > Network Admin Email
    • It is not the BuddyPress Site Setting > Email Users Settings > From Sender Email Address Override (this address ends up being the Reply-To: address)

    It has me stumped, and has messages landing in our user's junk/spam folders...

  15. frank thirteen
    Member
    Posted 2 years ago #

    Also @MikeWalsh, I just physically scanned every MySQL Table in my WP/BP install and I found no instance of that phantom email address being stored in the tables.

    I scanned ./wp-config.php and there is no email address stored tin the config file.

    But here is something interesting -- it is the same email address being sent From: by "Friendship Requests" and "Document Upload Notices" and "Group "Comments Notices" and "New Message Notices" and Group "Membership Request Notices".

    Does that help in any way?

  16. Mike Walsh
    Member
    Plugin Author

    Posted 2 years ago #

    It sounds like something in your mail system is modifying the header. If you want to see what the header looks like that Email Users constructs, you can enable debugging by editing the plugin file email-users.php and changing the following line (on our about line 46):

    Normal operation:

    define( 'MAILUSERS_DEBUG', false);

    Debug Mode:

    define( 'MAILUSERS_DEBUG', true);

    You will see quite a bit of extra information on the Dashboard when sending email with Debug enabled.

  17. Mike Walsh
    Member
    Plugin Author

    Posted 2 years ago #

    What Email Users does when constructing the header is the following:

    global $user_identity, $user_email, $user_ID;
    
    	get_currentuserinfo();
    	$from_name = $user_identity;
    	$from_address = $user_email;

    get_currentuserinfo() loads the global variables per the Codex.

  18. frank thirteen
    Member
    Posted 2 years ago #

    Thanks @Mike Walsh.

    So if I were to change:

    $from_name = $user_identity;

    to

    $from_name = $user_email;

    it looks like that would solve my problem. Agree? Is there a filter or do_action I can apply to my themes' functions script or do I have to hardcode my change? If hardcode, can you point me to the script file that contains the relational setting?

    Thanks @MikeWalsh.

  19. Mike Walsh
    Member
    Plugin Author

    Posted 2 years ago #

    No, I don't think it will make any difference at all because it appears that your mail server (or possibly PHP's mmail interface) is modifying the header after the call to wp_mail().

    Did you enable debugging and take a look at the mail header? I'd be curious to see what it says. If you want to mail it to me, use my WordPress username at gmail dot com. I'll be on a plane for the next 5 hours so I will be offline for a while.

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic

Tags