Understanding Email-Users Settings

Periodically I receive Help Requests (either from the WordPress Support Forum, a comment on my blog, or an email) for Email-Users.  Most of the requests involve why some users do or don’t receive email.

Each user has two values associated with their user id:

  1. Does the user receive mass email?
  2. Does the user receive post and/or page notifications?

The ability to control these settings by the user from their User Profile page was a feature of Email-Users long before I got involved.  I have enhanced this functionality to allow an Administrator have the ability to change the settings for a specific user as well as adding the ability to bulk change the settings for a large number of users.

The bulk change feature appears under the Email-Users menu as “User Settings”.  Looking at this page will show you the current state of each user with respect to receiving mass email and post/page notifications.

The administrator can also remove the ability for a user to change their own settings through the plugin settings.

When using the “Send Email to User(s)” or “Send Email to Group(s)” feature, the list of users or groups is extracted from the database based on the settings for their user id.  You can always send email to a single user regardless of their setting however if you select more than one recipient, the Mass Email setting for a user is honored and they will be dropped from the recipient list.

Here are some screen shots to illustrate the points made above.

Email Users v4.3.15 is now available

This afternoon I released v4.3.15 of Email Users. This update includes a number of enhancements, some bug fixes, and a bunch of translation improvements. Thanks in particular to Ponç J. Llaneras for helping with the myriad of translation issues.

  • Replaced use of deprecated function the_editor() with wp_editor().
  • Fixed Javascript conflict which affects Dashboard and Menu Management resulting from enqueing the WordPress ‘post’ library.
  • Fixed bug where user settings are not saved correctly when toggling user setting control.
  • Fixed bug when the dollar sign character ($) appears in the content of a page or post.
  • Added option to include sender in recipient list.
  • Numerous updates to make translation easier.
  • Updated Spanish and French translation files.

You can find the update on your Dashboard or in the WordPress Plugin Repository.

Email Users v4.3.15-beta-6 available

This morning I made a beta-6 version of Email Users v4.3.15 available for download from this site. I  hope this is the final beta version before the final release.  I am not aware of any outstanding bugs at this time.  This latest beta version has some more tweaks to aid in translation.

Download the beta release and please let me know if you run into any issues.

Email Users Beta (71 downloads)

Email Users v4.3.15-beta-5 available

This evening I made a beta-4 beta-5 version of Email Users v4.3.15 available for download from this site. I still hope to incorporate as many translation package updates as I can before the final release. This latest beta version has some more tuning to aid in translation.

Download the beta release and please let me know if you run into any issues.

Email Users Beta (71 downloads)

Email Users v4.3.15-beta-3 available

This morning I made a beta-3 version of Email Users v4.3.15 available for download from this site. I still hope to incorporate as many translation package updates as I can before the final release.

This latest beta version fixes some bugs where the names and ids or users or roles was not displayed in the recipient lists.

Download the beta release and please let me know if you run into any issues.

Email Users Beta (71 downloads)

Email Users v4.3.15-beta-2 available

This evening I have made a beta-2 version of Email Users v4.3.15 available for download from this site. I have not posted this version to the WordPress plugin repository yet as I’d like to incorporate as many translation package updates as I can before the final release.

This latest beta version includes translation catalog files generated with Poedit to help make the translation process easier.

Download the beta release and please let me know if you run into any issues.

Email Users Beta (71 downloads)

Email Users v4.3.15-beta available

This morning I have made a beta version of Email Users v4.3.15 available for download from this site. I have not posted this version to the WordPress plugin repository yet as I’d like to get some additional testing done on it before doing so as well as incorporate any translation package updates as I can before the final release (which I will likely label v4.4.0).

There are a couple of significant new features and a number of bug fixes in this version.

  1. Fixed the problem where a dollar sign in the post or page content followed by a number disappears.  This was happening due to  preg_replace() seeing the $nn pattern as part of its regular expression processing.
  2. Fixed issues with user settings disappearing.
  3. Added the ability to include the sender in the recipient list as an options setting.
  4. Fixed bug which prevented WordPress Dashboard and Menu Manager from working correctly.
  5. Changed a number of strings to make the process of creating a language package much easier.

Download the beta release and please let me know if you run into any issues.

Email Users Beta (71 downloads)

Email Users v4.3.14 released

This morning I pushed the v4.3.14 update to Email Users to the WordPress plugin repository.  This update adds a new Spanish language translation, updates the French language translation, and fixes a problem where users who have either the capability to send to a single user OR the capability to send to multiple users, but not both, receive a permission denied error when trying to send email.  A number of the permission errors have also been updated so they use the proper WordPress styling.

The Magic of the get_users() Function

While working on Email Users recently I encountered a performance problem with some SQL which I had received via the WordPress Hackers Mailing List back in January of 2008.  At the time I needed it for my wp-SwimTeam plugin (where I am still using it) and it served me well.  When I first committed a patch for Email Users (v3.4.0) I used this SQL to allow sorting of the users as prior to v3.4.0, only the usernames were displayed.

It turns out this SQL is pretty inefficient (I am by no means an SQL expert) and it was causing performance problems for people using Email Users with a large number of users.  Again I turned to the WP Hackers Mailing List and received some significantly improved SQL.

The ensuing discussion also recommended migrating my SQL to the WordPress API get_users() function.  I am all for using the API when I can as it is much safer and typically much easier to work with.  In this case, I couldn’t understand how it would help me retrieve the first and last names from the Meta table that I needed.  It wasn’t mentioned anywhere in the Codex so I was confused.

A subsequent post in the thread mentioned the “magic” of get_users() which I then tried and sure enough, the data I wanted was available.  Ok, now I am really confused.  Where does this magic data come from.  Fortunately another post referenced this article which explains how these magic methods work and why the data is available.  This is pretty neat and very useful although I have no idea how developers would know this exists based on the documentation in the Codex.

These “magic methods” strike me as one of those “inside baseball” things that not being a full time WordPress developer I’d never know about.  It is very useful and something I’ll certainly remember and use in the future.  Thanks to the WordPress Hackers Mailing List – an incredibly valuable resource.

I am now contributing to the E-Mail Users plugin

I am happy to say that I have been granted Subversion commit access to the popular Email Users plugin.  I have been using this plugin for a number of years and have submitted several patches which were included in the 3.4.x releases.  Recently I needed to add some functionality to support the MacDolphins web site and use of the plugin and after submitting a patch, I was invited to be a contributor by Vincent Prat at Marvin Labs which I gladly accepted.

The 4.0.0 release of Email Users is a pretty substantial change.  It updates the plugin to use the WordPress Options API and updated menu API.  It also adds a new feature that allows easy access to managing the email options for one or more users.  No more visiting the User Profile for each user, bulk actions are now available!

More to come over the next few days.