setNewsletterDoi example

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());
        $dataBag->set('salutationId', $customer->getSalutationId());
        $dataBag->set('title', $customer->getTitle());
        
Home | Imprint | This part of the site doesn't use cookies.