Compare commits
7 Commits
3.0.0-beta
...
3.0.0-beta
Author | SHA1 | Date | |
---|---|---|---|
|
18e2d26587 | ||
|
810a7bf544 | ||
|
1010c6f4f0 | ||
|
8dd698ec75 | ||
|
95e66f1f29 | ||
|
ac0460ab04 | ||
|
2d059debb7 |
@@ -8,25 +8,25 @@
|
|||||||
"require": {
|
"require": {
|
||||||
"php": ">=5.3.3",
|
"php": ">=5.3.3",
|
||||||
"twig/twig": "1.*",
|
"twig/twig": "1.*",
|
||||||
"cerdic/css-tidy": "*",
|
"cerdic/css-tidy": "^1.5.5",
|
||||||
"tburry/pquery": "*",
|
"tburry/pquery": "^1.1.1",
|
||||||
"j4mie/paris": "1.5.4",
|
"j4mie/paris": "1.5.4",
|
||||||
"swiftmailer/swiftmailer": "^5.4",
|
"swiftmailer/swiftmailer": "^5.4",
|
||||||
"mtdowling/cron-expression": "^1.1",
|
"mtdowling/cron-expression": "^1.1",
|
||||||
"nesbot/carbon": "^1.21",
|
"nesbot/carbon": "^1.21",
|
||||||
"soundasleep/html2text": "dev-master",
|
"soundasleep/html2text": "^0.3.4",
|
||||||
"sabberworm/php-css-parser": "^8.1"
|
"sabberworm/php-css-parser": "^8.1"
|
||||||
},
|
},
|
||||||
"require-dev": {
|
"require-dev": {
|
||||||
"codeception/codeception": "*",
|
"codeception/codeception": "^2.2.9",
|
||||||
"codeception/verify": "*",
|
"codeception/verify": "^0.3.3",
|
||||||
"consolidation/robo": "*",
|
"consolidation/robo": "^1.0.5",
|
||||||
"henrikbjorn/lurker": "^1.2",
|
"henrikbjorn/lurker": "^1.2",
|
||||||
"vlucas/phpdotenv": "*",
|
"vlucas/phpdotenv": "^2.4.0",
|
||||||
"umpirsky/twig-gettext-extractor": "1.1.*",
|
"umpirsky/twig-gettext-extractor": "1.1.*",
|
||||||
"raveren/kint": "^1.0",
|
"raveren/kint": "^1.0",
|
||||||
"squizlabs/php_codesniffer": "*",
|
"squizlabs/php_codesniffer": "^2.8.1",
|
||||||
"wimg/php-compatibility": "*",
|
"wimg/php-compatibility": "^7.1.2",
|
||||||
"simplyadmire/composer-plugins" : "@dev"
|
"simplyadmire/composer-plugins" : "@dev"
|
||||||
},
|
},
|
||||||
"autoload": {
|
"autoload": {
|
||||||
|
806
composer.lock
generated
806
composer.lock
generated
File diff suppressed because it is too large
Load Diff
@@ -43,10 +43,19 @@ class SendingQueue {
|
|||||||
self::BATCH_SIZE
|
self::BATCH_SIZE
|
||||||
);
|
);
|
||||||
foreach($subscriber_batches as $subscribers_to_process_ids) {
|
foreach($subscriber_batches as $subscribers_to_process_ids) {
|
||||||
$found_subscribers = SubscriberModel::findSubscribersInSegments(
|
if(!empty($newsletter_segments_ids[0])) {
|
||||||
$subscribers_to_process_ids, $newsletter_segments_ids
|
// Check that subscribers are in segments
|
||||||
)->findMany();
|
$found_subscribers = SubscriberModel::findSubscribersInSegments(
|
||||||
$found_subscribers_ids = SubscriberModel::extractSubscribersIds($found_subscribers);
|
$subscribers_to_process_ids, $newsletter_segments_ids
|
||||||
|
)->findMany();
|
||||||
|
$found_subscribers_ids = SubscriberModel::extractSubscribersIds($found_subscribers);
|
||||||
|
} else {
|
||||||
|
// No segments = Welcome emails
|
||||||
|
$found_subscribers = SubscriberModel::whereIn('id', $subscribers_to_process_ids)
|
||||||
|
->whereNull('deleted_at')
|
||||||
|
->findMany();
|
||||||
|
$found_subscribers_ids = SubscriberModel::extractSubscribersIds($found_subscribers);
|
||||||
|
}
|
||||||
// if some subscribers weren't found, remove them from the processing list
|
// if some subscribers weren't found, remove them from the processing list
|
||||||
if(count($found_subscribers_ids) !== count($subscribers_to_process_ids)) {
|
if(count($found_subscribers_ids) !== count($subscribers_to_process_ids)) {
|
||||||
$subscibers_to_remove = array_diff(
|
$subscibers_to_remove = array_diff(
|
||||||
|
@@ -4,7 +4,7 @@ if(!defined('ABSPATH')) exit;
|
|||||||
|
|
||||||
/*
|
/*
|
||||||
* Plugin Name: MailPoet
|
* Plugin Name: MailPoet
|
||||||
* Version: 3.0.0-beta.23
|
* Version: 3.0.0-beta.23.2
|
||||||
* Plugin URI: http://www.mailpoet.com
|
* Plugin URI: http://www.mailpoet.com
|
||||||
* Description: Create and send beautiful email newsletters, autoresponders, and post notifications without leaving WordPress. This is a beta version of our brand new plugin!
|
* Description: Create and send beautiful email newsletters, autoresponders, and post notifications without leaving WordPress. This is a beta version of our brand new plugin!
|
||||||
* Author: MailPoet
|
* Author: MailPoet
|
||||||
@@ -21,7 +21,7 @@ if(!defined('ABSPATH')) exit;
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
$mailpoet_plugin = array(
|
$mailpoet_plugin = array(
|
||||||
'version' => '3.0.0-beta.23',
|
'version' => '3.0.0-beta.23.2',
|
||||||
'filename' => __FILE__,
|
'filename' => __FILE__,
|
||||||
'path' => dirname(__FILE__),
|
'path' => dirname(__FILE__),
|
||||||
'autoloader' => dirname(__FILE__) . '/vendor/autoload.php',
|
'autoloader' => dirname(__FILE__) . '/vendor/autoload.php',
|
||||||
|
22
package.json
22
package.json
@@ -17,14 +17,14 @@
|
|||||||
"handlebars": "3.0.3",
|
"handlebars": "3.0.3",
|
||||||
"history": "1.13.1",
|
"history": "1.13.1",
|
||||||
"html2canvas": "0.5.0-alpha2",
|
"html2canvas": "0.5.0-alpha2",
|
||||||
"interact.js": "latest",
|
"interact.js": "~1.2.8",
|
||||||
"moment": "^2.10.3",
|
"moment": "^2.10.3",
|
||||||
"napa": "^1.2.0",
|
"napa": "^1.2.0",
|
||||||
"papaparse": "4.1.1",
|
"papaparse": "4.1.1",
|
||||||
"parsleyjs": "^2.1.2",
|
"parsleyjs": "^2.1.2",
|
||||||
"react": "latest",
|
"react": "~15.4.2",
|
||||||
"react-dom": "latest",
|
"react-dom": "~15.4.2",
|
||||||
"react-router": "latest",
|
"react-router": "~3.0.2",
|
||||||
"react-string-replace": "^0.3.2",
|
"react-string-replace": "^0.3.2",
|
||||||
"select2": "^4.0.0",
|
"select2": "^4.0.0",
|
||||||
"spectrum-colorpicker": "^1.6.2",
|
"spectrum-colorpicker": "^1.6.2",
|
||||||
@@ -33,22 +33,22 @@
|
|||||||
"velocity-animate": "1.2.3"
|
"velocity-animate": "1.2.3"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"expose-loader": "latest",
|
"expose-loader": "~0.7.3",
|
||||||
"exports-loader": "latest",
|
"exports-loader": "~0.6.4",
|
||||||
"imports-loader": "latest",
|
"imports-loader": "~0.7.1",
|
||||||
"babel-core": "^5.8.22",
|
"babel-core": "^5.8.22",
|
||||||
"babel-loader": "^5.3.2",
|
"babel-loader": "^5.3.2",
|
||||||
"amd-inject-loader": "latest",
|
"amd-inject-loader": "~0.5.0",
|
||||||
"chai": "2.2.0",
|
"chai": "2.2.0",
|
||||||
"chai-jq": "0.0.8",
|
"chai-jq": "0.0.8",
|
||||||
"grunt-cli": "latest",
|
"grunt-cli": "~1.2.0",
|
||||||
"jquery": "2.1.4",
|
"jquery": "2.1.4",
|
||||||
"jsdom": "3.1.2",
|
"jsdom": "3.1.2",
|
||||||
"mocha": "2.2.1",
|
"mocha": "2.2.1",
|
||||||
"nib": "latest",
|
"nib": "~1.1.2",
|
||||||
"sinon": "1.14.1",
|
"sinon": "1.14.1",
|
||||||
"sinon-chai": "2.7.0",
|
"sinon-chai": "2.7.0",
|
||||||
"stylus": "latest",
|
"stylus": "~0.54.5",
|
||||||
"webpack": "1.11.0"
|
"webpack": "1.11.0"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -3,7 +3,7 @@ Contributors: mailpoet, wysija
|
|||||||
Tags: newsletter, email, welcome email, post notification, autoresponder, signup, smtp
|
Tags: newsletter, email, welcome email, post notification, autoresponder, signup, smtp
|
||||||
Requires at least: 4.6
|
Requires at least: 4.6
|
||||||
Tested up to: 4.7.3
|
Tested up to: 4.7.3
|
||||||
Stable tag: 3.0.0-beta.23
|
Stable tag: 3.0.0-beta.23.2
|
||||||
Create and send beautiful emails and newsletters from WordPress.
|
Create and send beautiful emails and newsletters from WordPress.
|
||||||
|
|
||||||
== Description ==
|
== Description ==
|
||||||
@@ -84,7 +84,7 @@ Our [support site](https://docs.mailpoet.com/) has plenty of articles. You can w
|
|||||||
|
|
||||||
== Changelog ==
|
== Changelog ==
|
||||||
|
|
||||||
= 3.0.0-beta.23 - 2017-03-14 =
|
= 3.0.0-beta.23.2 - 2017-03-14 =
|
||||||
* Improved: added plugin translations to Dutch, English (UK), French, German, Italian, Portuguese (Brazil), Portuguese (Portugal), Russian and Spanish languages. Thank you translators!
|
* Improved: added plugin translations to Dutch, English (UK), French, German, Italian, Portuguese (Brazil), Portuguese (Portugal), Russian and Spanish languages. Thank you translators!
|
||||||
* Fixed: unsubscribed subscriber will no longer receive newsletters (woops!). Thanks, Oskar;
|
* Fixed: unsubscribed subscriber will no longer receive newsletters (woops!). Thanks, Oskar;
|
||||||
* Fixed: previously scheduled send tasks are rescheduled when post notifications' scheduling options change. Thanks, Karen and Eric!
|
* Fixed: previously scheduled send tasks are rescheduled when post notifications' scheduling options change. Thanks, Karen and Eric!
|
||||||
|
@@ -282,6 +282,54 @@ class SendingQueueTest extends MailPoetTest {
|
|||||||
expect($statistics)->notEquals(false);
|
expect($statistics)->notEquals(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function testItCanProcessWelcomeNewsletters() {
|
||||||
|
$this->newsletter->type = Newsletter::TYPE_WELCOME;
|
||||||
|
$this->newsletter_segment->delete();
|
||||||
|
|
||||||
|
$sending_queue_worker = new SendingQueueWorker(
|
||||||
|
$timer = false,
|
||||||
|
Stub::make(
|
||||||
|
new MailerTask(),
|
||||||
|
array(
|
||||||
|
'send' => Stub::exactly(1, function($newsletter, $subscriber) {
|
||||||
|
// newsletter body should not be empty
|
||||||
|
expect(!empty($newsletter['body']['html']))->true();
|
||||||
|
expect(!empty($newsletter['body']['text']))->true();
|
||||||
|
return true;
|
||||||
|
})
|
||||||
|
)
|
||||||
|
)
|
||||||
|
);
|
||||||
|
$sending_queue_worker->process();
|
||||||
|
|
||||||
|
// newsletter status is set to sent
|
||||||
|
$updated_newsletter = Newsletter::findOne($this->newsletter->id);
|
||||||
|
expect($updated_newsletter->status)->equals(Newsletter::STATUS_SENT);
|
||||||
|
|
||||||
|
// queue status is set to completed
|
||||||
|
$updated_queue = SendingQueue::findOne($this->queue->id);
|
||||||
|
expect($updated_queue->status)->equals(SendingQueue::STATUS_COMPLETED);
|
||||||
|
|
||||||
|
// queue subscriber processed/to process count is updated
|
||||||
|
$updated_queue->subscribers = $updated_queue->getSubscribers();
|
||||||
|
expect($updated_queue->subscribers)->equals(
|
||||||
|
array(
|
||||||
|
'to_process' => array(),
|
||||||
|
'processed' => array($this->subscriber->id)
|
||||||
|
)
|
||||||
|
);
|
||||||
|
expect($updated_queue->count_total)->equals(1);
|
||||||
|
expect($updated_queue->count_processed)->equals(1);
|
||||||
|
expect($updated_queue->count_to_process)->equals(0);
|
||||||
|
|
||||||
|
// statistics entry should be created
|
||||||
|
$statistics = StatisticsNewsletters::where('newsletter_id', $this->newsletter->id)
|
||||||
|
->where('subscriber_id', $this->subscriber->id)
|
||||||
|
->where('queue_id', $this->queue->id)
|
||||||
|
->findOne();
|
||||||
|
expect($statistics)->notEquals(false);
|
||||||
|
}
|
||||||
|
|
||||||
function testItRemovesNonexistentSubscribersFromProcessingList() {
|
function testItRemovesNonexistentSubscribersFromProcessingList() {
|
||||||
$queue = $this->queue;
|
$queue = $this->queue;
|
||||||
$queue->subscribers = serialize(
|
$queue->subscribers = serialize(
|
||||||
|
Reference in New Issue
Block a user