• Resolved Gengar003

    (@gengar003)


    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?

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

Viewing 7 replies - 1 through 7 (of 7 total)
  • @gengar003,

    That is magnificent, thank you very much for a detailed bug hunt and suggested fix. I’ll get this patched for 7.2 and the code that runs on upgrade should fix any existing users too.

    For the time being adding your line:

    update_user_meta($user_ID, $this->get_usermeta_keyname('s2_authors'), '');

    After line 1252 and then the new 1268 (so 1267 before the first line addition) should fix this for good.

    @gengar003,

    AWESOME job tracking this down. I had the same issue here

    Thanks!!!

    This same bug has been driving me crazy. Unfortunately, I only found this by tracking it down myself and googling “s2_authors” for confirmation.

    This SQL isn’t the prettiest, but it should fix the existing users:
    insert into wp_usermeta (user_id, meta_key, meta_value) select wp_users.id, 's2_authors', '' from wp_users where id in (select user_id from wp_usermeta where meta_key = 's2_autosub' and meta_value='yes') and id not in (select user_id from wp_usermeta where meta_key = 's2_authors');

    Does anyone know whether this was fixed? I am running the latest version and it looks like code was substantially rejigged, but the client says the problem persists. New users are not automatically signed up.

    @fdyocum,

    This was fixed in 7.3 and the code changes made there have persisted into the current version.

    Have you checked the auto subscribe settings at Subscribe2->Settings?

    @matthew – Thanks for responding.

    The auto subscribe is checked. I note there is a problem with mass changing of email settings (also a problem).

    Should I install the development code, referenced in that thread in the hope that both will disappear?

    @fdyocum,

    By all means give the development code a try, it will certainly fix the bulk changing bug. I’m not sure that will impact on the Auto-subscribe code though as that only applies to new users. That said though, updating the code runs an upgrade function that may also be worthwhile in your case.

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘[Plugin: Subscribe2] Bug Report Solution: New users are auto-subscribed but can't receive mai’ is closed to new replies.