Adds IP address field to export

This commit is contained in:
Vlad
2018-02-15 22:04:58 -05:00
committed by pavel-mailpoet
parent c8f334d782
commit e87134eca4
3 changed files with 6 additions and 3 deletions

View File

@ -181,6 +181,7 @@ class Export {
'first_name',
'last_name',
'email',
'subscribed_ip',
array(
'global_status' => Subscriber::$_table . '.status'
),

View File

@ -33,12 +33,13 @@ class ImportExportFactory {
'first_name' => __('First name', 'mailpoet'),
'last_name' => __('Last name', 'mailpoet')
);
if ($this->action === 'export') {
if($this->action === 'export') {
$fields = array_merge(
$fields,
array(
'list_status' => _x('List status', 'Subscription status', 'mailpoet'),
'global_status' => _x('Global status', 'Subscription status', 'mailpoet')
'global_status' => _x('Global status', 'Subscription status', 'mailpoet'),
'subscribed_ip' => __('IP address', 'mailpoet')
)
);
}

View File

@ -122,7 +122,8 @@ class ImportExportFactoryTest extends \MailPoetTest {
'first_name',
'last_name',
'list_status',
'global_status'
'global_status',
'subscribed_ip'
);
foreach($export_fields as $field) {
expect(in_array($field, array_keys($subsriberFields)))->true();