[Plugin: Subscribe2] Bug Report Solution: New users are auto-subscribed but can't receive mai
-
I am running Subscribe2 version 7.1 on a WordPress 3.3.1 Multi-Site setup.
On one of the sites, I had “auto-subscribe new users” enabled.
When new user accounts were registered, they appeared to be subscribed automatically, but would not receive any e-mails about posts from Subscribe2. They could receive e-mails sent from the “Send Email” interface.
Once a user (or an administrator) updated an affected user’s subscribe2 settings, even if they left all the settings alone and just saved them with no changes, the user would become able to receive emails about posts.
I tracked this down to the s2_authors usermeta field.
function register(…) in subscribe2.php does not create (update_usermeta) this field. So when a user registers, if they are truly a new user, they will not have a usermeta entry for s2_authors.
The user_menu(…) function, around line 2470, will update_usermeta for s2_authors to *something*, regardless of whether anything was set for that option. Afterward, that user will have an s2_authors usermeta entry, and be able to receive e-mail.
Manually adding this entry in the database for a given user will enable them to begin receiving post e-mails. Removing it again will stop them.
The solution could either be to add to function register(…) code to ensure that s2_authors is initialized, or (and I didn’t look into this next solution) to modify the code that sends e-mails to be able to succeed even if a usermeta entry for s2_authors doesn’t exist.
If it were me, just trying to fix my subscribe2 install and get it working (as opposed to a subscribe2 dev, looking into an appropriate long-tem solution), I would insert the following:
update_user_meta($user_ID, $this->get_usermeta_keyname('s2_authors'), '');
At line 1236 in subscribe2.php, right before
// has this user previously signed up for email notification?
- The topic ‘[Plugin: Subscribe2] Bug Report Solution: New users are auto-subscribed but can't receive mai’ is closed to new replies.