Create a new table for stats notification
[MAILPOET-1571]
This commit is contained in:
@@ -86,6 +86,7 @@ class Database {
|
|||||||
$statistics_forms = Env::$db_prefix . 'statistics_forms';
|
$statistics_forms = Env::$db_prefix . 'statistics_forms';
|
||||||
$mapping_to_external_entities = Env::$db_prefix . 'mapping_to_external_entities';
|
$mapping_to_external_entities = Env::$db_prefix . 'mapping_to_external_entities';
|
||||||
$log = Env::$db_prefix . 'log';
|
$log = Env::$db_prefix . 'log';
|
||||||
|
$stats_notifications = Env::$db_prefix . 'stats_notifications';
|
||||||
|
|
||||||
define('MP_SETTINGS_TABLE', $settings);
|
define('MP_SETTINGS_TABLE', $settings);
|
||||||
define('MP_SEGMENTS_TABLE', $segments);
|
define('MP_SEGMENTS_TABLE', $segments);
|
||||||
@@ -112,6 +113,7 @@ class Database {
|
|||||||
define('MP_STATISTICS_FORMS_TABLE', $statistics_forms);
|
define('MP_STATISTICS_FORMS_TABLE', $statistics_forms);
|
||||||
define('MP_MAPPING_TO_EXTERNAL_ENTITIES_TABLE', $mapping_to_external_entities);
|
define('MP_MAPPING_TO_EXTERNAL_ENTITIES_TABLE', $mapping_to_external_entities);
|
||||||
define('MP_LOG_TABLE', $log);
|
define('MP_LOG_TABLE', $log);
|
||||||
|
define('MP_STATS_NOTIFICATIONS_TABLE', $stats_notifications);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -18,6 +18,7 @@ class Migrator {
|
|||||||
'settings',
|
'settings',
|
||||||
'custom_fields',
|
'custom_fields',
|
||||||
'scheduled_tasks',
|
'scheduled_tasks',
|
||||||
|
'stats_notifications',
|
||||||
'scheduled_task_subscribers',
|
'scheduled_task_subscribers',
|
||||||
'sending_queues',
|
'sending_queues',
|
||||||
'subscribers',
|
'subscribers',
|
||||||
@@ -126,6 +127,18 @@ class Migrator {
|
|||||||
return $this->sqlify(__FUNCTION__, $attributes);
|
return $this->sqlify(__FUNCTION__, $attributes);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function statsNotifications() {
|
||||||
|
$attributes = array(
|
||||||
|
'id int(11) unsigned NOT NULL AUTO_INCREMENT,',
|
||||||
|
'newsletter_id int(11) unsigned NOT NULL,',
|
||||||
|
'task_id int(11) unsigned NOT NULL,',
|
||||||
|
'PRIMARY KEY (id),',
|
||||||
|
'KEY newsletter_id (newsletter_id),',
|
||||||
|
'KEY task_id (task_id)',
|
||||||
|
);
|
||||||
|
return $this->sqlify(__FUNCTION__, $attributes);
|
||||||
|
}
|
||||||
|
|
||||||
function scheduledTaskSubscribers() {
|
function scheduledTaskSubscribers() {
|
||||||
$attributes = array(
|
$attributes = array(
|
||||||
'task_id int(11) unsigned NOT NULL,',
|
'task_id int(11) unsigned NOT NULL,',
|
||||||
|
@@ -6,7 +6,18 @@ use Carbon\Carbon;
|
|||||||
use MailPoet\Models\SendingQueue;
|
use MailPoet\Models\SendingQueue;
|
||||||
use MailPoet\Models\ScheduledTask;
|
use MailPoet\Models\ScheduledTask;
|
||||||
use MailPoet\Models\Setting;
|
use MailPoet\Models\Setting;
|
||||||
use MailPoet\Tasks\Sending;
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* TODO:
|
||||||
|
* - finish stats_notifications table, test if it is working and the migration is creating the table
|
||||||
|
* - remove all the SendingQueue from here
|
||||||
|
* - in schedule method add a row to stats_notifications table
|
||||||
|
* - when sending of post notification or a standard newsletter is finished call schedule
|
||||||
|
* - add processing of this task to Daemon
|
||||||
|
* - check JIRA what to do next and how to send the newsletter
|
||||||
|
* - see \MailPoet\Subscribers\NewSubscriberNotificationMailer how to send an email, now with DI everything should be easy
|
||||||
|
*/
|
||||||
|
|
||||||
class StatsNotifications {
|
class StatsNotifications {
|
||||||
|
|
||||||
|
9
lib/Models/StatsNotification.php
Normal file
9
lib/Models/StatsNotification.php
Normal file
@@ -0,0 +1,9 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace MailPoet\Models;
|
||||||
|
|
||||||
|
class StatsNotification extends Model {
|
||||||
|
public static $_table = MP_STATS_NOTIFICATIONS_TABLE;
|
||||||
|
|
||||||
|
|
||||||
|
}
|
Reference in New Issue
Block a user