protected function preSerializeEntity(&$entity, $action = 'view')
    {
        // deconstruct the campaign_settings blob and merge campaign entities in.
        $list             = [];
        $campaignSettings = json_decode($entity->getCampaignSettings(), true);
        $campaignModel    = $this->container->get('mautic.campaign.model.campaign');
        if (!empty($campaignSettings)) {
            foreach ($campaignSettings as $campaignSetting) {
                if (!empty($campaignSetting)) {
                    foreach ($campaignSetting as $setting) {
                        // get campaign name or other fields to merge with this data.
                        $campaign                       = $campaignModel->getEntity($setting['campaignId']);
                        if ($campaign && $campaign instanceof Campaign) {
                            $campaignName                   = $campaign->getName();
                            $campaignDescription            = $campaign->getDescription();
                            $setting['campaignName']        = $campaignName;
                            $setting['campaignDescription'] = $campaignDescription;
                            $list[$setting['campaignId']]   = $setting;
                            unset($campaign, $campaignName, $campaignDescription);
                        }
                    }
                }
            }
            $entity->setCampaignList($list);
        }
    }