On some slow host, the `newsletter` table get filled with duplicated `notification_history` marked as `sending` that never get sent. To prevent this we've made the two following changes: * We prevent firing `publis_*` hooks on post_type which are excluded from search. * We do not schedule a new post notification email if one has an `notification_history` entry marked as `sending`. [MAILPOET-1371]
15 lines
453 B
PHP
15 lines
453 B
PHP
<?php
|
|
namespace MailPoet\Test\Config;
|
|
|
|
use MailPoet\Config\Hooks;
|
|
use MailPoet\WP\Posts as WPPosts;
|
|
|
|
class HooksTest extends \MailPoetTest {
|
|
function testItHooksSchedulerToMultiplePostTypes() {
|
|
$hooks = new Hooks();
|
|
$hooks->setupPostNotifications();
|
|
foreach(WPPosts::getTypes() as $post_type) {
|
|
expect(has_filter('publish_' . $post_type, '\MailPoet\Newsletter\Scheduler\Scheduler::schedulePostNotification'))->notEmpty();
|
|
}
|
|
}
|
|
} |