Manage subscriptions
- make use of the SubscriberSegment::status column to keep track of unsubscriptions - unsubscribed segments now appear grayed out in the Subscribers listing - added unsubscribed_at after segment names when editing a subscriber - added date() method for Twig (uses WP's date format / date_offset) - fixed typo in Form iframe export - fixed unit test for Newsletters - updated selection component (JSX) to allow more customization
This commit is contained in:
@@ -206,20 +206,11 @@ class Newsletters {
|
||||
|
||||
$listing_data = $listing->get();
|
||||
|
||||
foreach($listing_data['items'] as &$item) {
|
||||
// get segments
|
||||
$segments = NewsletterSegment::select('segment_id')
|
||||
->where('newsletter_id', $item['id'])
|
||||
->findMany();
|
||||
$item['segments'] = array_map(function($relation) {
|
||||
return $relation->segment_id;
|
||||
}, $segments);
|
||||
|
||||
// get queue
|
||||
$queue = SendingQueue::where('newsletter_id', $item['id'])
|
||||
->orderByDesc('updated_at')
|
||||
->findOne();
|
||||
$item['queue'] = ($queue !== false) ? $queue->asArray() : null;
|
||||
foreach($listing_data['items'] as $key => $newsletter) {
|
||||
$listing_data['items'][$key] = $newsletter
|
||||
->withSegments()
|
||||
->withSendingQueue()
|
||||
->asArray();
|
||||
}
|
||||
|
||||
return $listing_data;
|
||||
|
Reference in New Issue
Block a user