NewsletterAccountPagelet example

$status = 'undefined';
        if ($responseStruct->getAccountNewsletterRecipient()->getStatus()) {
            $status = $responseStruct->getAccountNewsletterRecipient()->getStatus();
        }

        return $status;
    }

    protected function getBasePagelet(CustomerEntity $customer, string $salesChannelId): NewsletterAccountPagelet
    {
        $newsletterAccountPagelet = new NewsletterAccountPagelet();
        $newsletterAccountPagelet->setCustomer($customer);
        $newsletterAccountPagelet->setNewsletterDoi(
            (bool) $this->systemConfigService->get('core.newsletter.doubleOptInRegistered', $salesChannelId)
        );

        return $newsletterAccountPagelet;
    }

    private function hydrateFromCustomer(RequestDataBag $dataBag, CustomerEntity $customer): RequestDataBag
    {
        $dataBag->set('email', $customer->getEmail());
        
Home | Imprint | This part of the site doesn't use cookies.