'confirmedAt' =>
$recipient->
getConfirmedAt(),
'em' =>
$dataBag->
get('em'
),
];
$this->validator->
validate($data,
$this->
getBeforeConfirmSubscribeValidation(hash('sha1',
$recipient->
getEmail())));
$data['status'
] = NewsletterSubscribeRoute::STATUS_OPT_IN;
$data['confirmedAt'
] =
new \
DateTime();
$this->newsletterRecipientRepository->
update([$data],
$context->
getContext());
$event =
new NewsletterConfirmEvent($context->
getContext(),
$recipient,
$context->
getSalesChannel()->
getId());
$this->eventDispatcher->
dispatch($event);
return new NoContentResponse();
} private function getNewsletterRecipient(string
$identifier, string
$value, Context
$context): NewsletterRecipientEntity
{ $criteria =
new Criteria();
$criteria->
addFilter(new EqualsFilter($identifier,
$value));
$criteria->
addAssociation('salutation'
);
$criteria->
setLimit(1
);