Add 'Bounced' status to subscribers [MAILPOET-684]
Fix SubscriberTest->testItHasGroupFilter() making only one of four assertions due to lack of data. Fix a small issue with Import. Unexpected values for the status field were converted to 'unconfirmed' rather than 'subscribed' due to non-strict comparison in in_array(). This hindered 'bounced' status import as well.
This commit is contained in:
@ -302,18 +302,24 @@ class Import {
|
||||
-1,
|
||||
'-1',
|
||||
'false'
|
||||
),
|
||||
'bounced' => array(
|
||||
'bounced'
|
||||
)
|
||||
);
|
||||
$subscribers_data['status'] = array_map(function($state) use ($statuses) {
|
||||
if(in_array(strtolower($state), $statuses['subscribed'])) {
|
||||
if(in_array(strtolower($state), $statuses['subscribed'], true)) {
|
||||
return 'subscribed';
|
||||
}
|
||||
if(in_array(strtolower($state), $statuses['unsubscribed'])) {
|
||||
if(in_array(strtolower($state), $statuses['unsubscribed'], true)) {
|
||||
return 'unsubscribed';
|
||||
}
|
||||
if(in_array(strtolower($state), $statuses['unconfirmed'])) {
|
||||
if(in_array(strtolower($state), $statuses['unconfirmed'], true)) {
|
||||
return 'unconfirmed';
|
||||
}
|
||||
if(in_array(strtolower($state), $statuses['bounced'], true)) {
|
||||
return 'bounced';
|
||||
}
|
||||
return 'subscribed'; // make "subscribed" a default status
|
||||
}, $subscribers_data['status']);
|
||||
return array(
|
||||
|
Reference in New Issue
Block a user