• Resolved karlrt

    (@karlrt)


    All my subscribers get two emails for each post instead of one only.

    I viewed the header and the email: They look identical, the only difference is the time (it takes about 3 minutes to send all the emails from the server, so there is a 3 minutes gap between the two emails for each subscriber)

    How can I debug this, what can cause these problems? Here is a list of plugins in use that I think might affect this?

    auto-schedule posts

    publish to schedule

    post-revision workflow

    https://www.ads-software.com/plugins/subscribe2/

Viewing 5 replies - 1 through 5 (of 5 total)
  • @karlrt,

    Have a look here:
    https://subscribe2.wordpress.com/2013/09/17/troubleshooting-emails-in-subscribe2/

    And maybe try the email logging plugin.

    Thread Starter karlrt

    (@karlrt)

    The problem seems to be with the “publish to schedule” plugin. Once deactivated, only one email goes out. Do I need to do anything to get this on the list of known conflicts?

    @karlrt,

    Having reviewed the code thanks to your excellent work narrowing down the issue I think I understand the problem and may even have a fix.

    Try this, in the classes/class-s2-core.php file find these lines:

    $statuses = apply_filters( 's2_post_statuses', array( 'new', 'draft', 'auto-draft', 'pending' ) );
    if ( 'yes' === $this->subscribe2_options['private'] ) {
    	foreach ( $statuses as $status ) {
    		add_action( "{$status}_to_private", array( &$this, 'publish' ) );
    	}
    }
    array_push( $statuses, 'private', 'future' );
    foreach ( $statuses as $status ) {
    	add_action( "{$status}_to_publish", array( &$this, 'publish' ) );
    }

    And edit that to:

    $statuses = apply_filters( 's2_post_statuses', array() );
    if ( 'yes' === $this->subscribe2_options['private'] ) {
    	foreach ( $statuses as $status ) {
    		add_action( "{$status}_to_private", array( &$this, 'publish' ) );
    	}
    }
    array_push( $statuses, 'private', 'future' );
    foreach ( $statuses as $status ) {
    	add_action( "{$status}_to_publish", array( &$this, 'publish' ) );
    }

    Notice the array in the first line is now empty. If that works and allows you to use the two plugins together let me know and I’ll post a more permanent solution that will be preserved through upgrades.

    Thread Starter karlrt

    (@karlrt)

    Yes it worked indeed with my testing environment!

    I will not try it on my productive site, just disabled the publish to schedule until this gets fixed with a proper update ??

    @karlrt,

    Great news that the fix worked. If you really need the Publish to Schedule then the more permanent fix is now detailed on the Conflicts page.

    Unfortunately, there isn’t really a way to account for this and fix it in the Subscribe2 code so the site specific plugin code is probably the best way to allow use of both plugins.

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘subscribe2 sends out two messages for each post’ is closed to new replies.