$this->eventDispatcher->
dispatch($event);
return new NoContentResponse();
} /**
* @deprecated tag:v6.6.0 - reason:visibility-change - will be private in v6.6.0
*/
public function isNewsletterDoi(SalesChannelContext
$context): ?bool
{ if ($context->
getCustomerId() === null
) { return $this->systemConfigService->
getBool('core.newsletter.doubleOptIn',
$context->
getSalesChannelId());
} return $this->systemConfigService->
getBool('core.newsletter.doubleOptInRegistered',
$context->
getSalesChannelId());
} private function getOptInValidator(DataBag
$dataBag, SalesChannelContext
$context, bool
$validateStorefrontUrl): DataValidationDefinition
{ $definition =
new DataValidationDefinition('newsletter_recipient.create'
);
$definition->
add('email',
new NotBlank(),
new Email()) ->
add('option',
new NotBlank(),
new Choice(array_keys($this->
getOptionSelection($context))));