Merge pull request #1355 from mailpoet/subscriber-source

Subscriber source [MAILPOET-1377]
This commit is contained in:
Michelle Shull
2018-05-21 08:17:00 -04:00
committed by GitHub
3 changed files with 61 additions and 0 deletions

View File

@@ -4,6 +4,7 @@ namespace MailPoet\Subscribers\ImportExport\PersonalDataExporters;
use MailPoet\Models\CustomField;
use MailPoet\Models\Subscriber;
use MailPoet\Subscribers\Source;
class SubscriberExporter {
@@ -70,6 +71,12 @@ class SubscriberExporter {
);
}
}
$result[] = array(
'name' => __("Subscriber's subscription source", 'mailpoet'),
'value' => $this->formatSource($subscriber->source),
);
return $result;
}
@@ -82,4 +89,21 @@ class SubscriberExporter {
return $result;
}
private function formatSource($source) {
switch ($source) {
case Source::WORDPRESS_USER:
return __('Subscriber information synchronized via WP user sync', 'mailpoet');
case Source::FORM:
return __('Subscription via a MailPoet subscription form', 'mailpoet');
case Source::API:
return __('Added by a 3rd party via MailPoet 3 API', 'mailpoet');
case Source::ADMINISTRATOR:
return __('Created by the administrator', 'mailpoet');
case Source::IMPORTED:
return __('Imported by the administrator', 'mailpoet');
default:
return __('Unknown', 'mailpoet');
}
}
}