Fixed sending confirmation email to new subscribers (first time)
- fixed newsletters listing issue with queue
This commit is contained in:
@@ -135,7 +135,7 @@ define(
|
|||||||
});
|
});
|
||||||
},
|
},
|
||||||
renderStatus: function(item) {
|
renderStatus: function(item) {
|
||||||
if(item.queue === false) {
|
if(!item.queue) {
|
||||||
return (
|
return (
|
||||||
<span>Not sent yet.</span>
|
<span>Not sent yet.</span>
|
||||||
);
|
);
|
||||||
|
@@ -59,7 +59,7 @@ class Initializer {
|
|||||||
\ORM::configure('password', Env::$db_password);
|
\ORM::configure('password', Env::$db_password);
|
||||||
\ORM::configure('logging', WP_DEBUG);
|
\ORM::configure('logging', WP_DEBUG);
|
||||||
\ORM::configure('logger', function($query, $time) {
|
\ORM::configure('logger', function($query, $time) {
|
||||||
// error_log("\n".$query."\n");
|
// error_log("\n".$query."\n");
|
||||||
});
|
});
|
||||||
|
|
||||||
\ORM::configure('driver_options', array(
|
\ORM::configure('driver_options', array(
|
||||||
|
@@ -74,13 +74,14 @@ class Newsletter extends Model {
|
|||||||
|
|
||||||
function withSendingQueue() {
|
function withSendingQueue() {
|
||||||
$queue = $this->getQueue();
|
$queue = $this->getQueue();
|
||||||
if($queue !== false) {
|
if($queue === false) {
|
||||||
|
$this->queue = false;
|
||||||
|
} else {
|
||||||
$this->queue = $queue->asArray();
|
$this->queue = $queue->asArray();
|
||||||
}
|
}
|
||||||
return $this;
|
return $this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
static function search($orm, $search = '') {
|
static function search($orm, $search = '') {
|
||||||
return $orm->where_like('subject', '%' . $search . '%');
|
return $orm->where_like('subject', '%' . $search . '%');
|
||||||
}
|
}
|
||||||
|
@@ -182,8 +182,11 @@ class Subscriber extends Model {
|
|||||||
}
|
}
|
||||||
|
|
||||||
$subscriber = self::createOrUpdate($subscriber_data);
|
$subscriber = self::createOrUpdate($subscriber_data);
|
||||||
|
$errors = $subscriber->getErrors();
|
||||||
|
|
||||||
|
if($errors === false && $subscriber->id > 0) {
|
||||||
|
$subscriber = self::findOne($subscriber->id);
|
||||||
|
|
||||||
if($subscriber !== false && $subscriber->id() > 0) {
|
|
||||||
// restore deleted subscriber
|
// restore deleted subscriber
|
||||||
if($subscriber->deleted_at !== NULL) {
|
if($subscriber->deleted_at !== NULL) {
|
||||||
$subscriber->setExpr('deleted_at', 'NULL');
|
$subscriber->setExpr('deleted_at', 'NULL');
|
||||||
|
Reference in New Issue
Block a user