Skip to content

Commit 43fe4d5

Browse files
committed
Add: fields to export
1 parent 86c72fa commit 43fe4d5

4 files changed

Lines changed: 14 additions & 5 deletions

File tree

src/Subscription/Request/SubscribersExportRequest.php

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,13 +47,16 @@ enum: ['any', 'signup', 'changed', 'changelog', 'subscribed']
4747
'email',
4848
'confirmed',
4949
'blacklisted',
50+
// 'manualConfirm',
5051
'bounceCount',
5152
'createdAt',
5253
'updatedAt',
5354
'uniqueId',
5455
'htmlEmail',
56+
'rssFrequency',
5557
'disabled',
5658
'extraData',
59+
'foreignKey',
5760
],
5861
),
5962
],
@@ -90,13 +93,16 @@ class SubscribersExportRequest implements RequestInterface
9093
'email',
9194
'confirmed',
9295
'blacklisted',
96+
// 'manualConfirm',
9397
'bounceCount',
9498
'createdAt',
9599
'updatedAt',
96100
'uniqueId',
97101
'htmlEmail',
102+
'rssFrequency',
98103
'disabled',
99-
'extraData'
104+
'extraData',
105+
'foreignKey',
100106
];
101107

102108
private function resolveDates(): array

src/Subscription/Serializer/SubscriberNormalizer.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -67,8 +67,8 @@ public function normalize($object, string $format = null, array $context = []):
6767
return [
6868
'id' => $object->getId(),
6969
'email' => $object->getEmail(),
70-
'created_at' => $object->getCreatedAt()->format('Y-m-d\TH:i:sP'),
71-
'updated_at' => $object->getUpdatedAt()->format('Y-m-d\TH:i:sP'),
70+
'created_at' => $object->getCreatedAt()?->format('Y-m-d\TH:i:sP'),
71+
'updated_at' => $object->getUpdatedAt()?->format('Y-m-d\TH:i:sP'),
7272
'confirmed' => $object->isConfirmed(),
7373
'blacklisted' => $object->isBlacklisted(),
7474
'bounce_count' => $object->getBounceCount(),

tests/Unit/Subscription/Serializer/SubscriberNormalizerTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ public function testNormalize(): void
5858
'id' => 101,
5959
'email' => 'test@example.com',
6060
'created_at' => '2024-12-31T12:00:00+00:00',
61-
'updated_at' => '',
61+
'updated_at' => null,
6262
'confirmed' => true,
6363
'blacklisted' => false,
6464
'bounce_count' => 0,

tests/Unit/Subscription/Serializer/SubscribersExportRequestNormalizerTest.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,13 +58,16 @@ public function testNormalizeWithDefaultValues(): void
5858
'email',
5959
'confirmed',
6060
'blacklisted',
61+
// 'manualConfirm',
6162
'bounceCount',
6263
'createdAt',
6364
'updatedAt',
6465
'uniqueId',
6566
'htmlEmail',
67+
'rssFrequency',
6668
'disabled',
67-
'extraData'
69+
'extraData',
70+
'foreignKey',
6871
],
6972
];
7073

0 commit comments

Comments
 (0)