$criteria =
new Criteria();
$criteria->
addFilter( new MultiFilter(MultiFilter::CONNECTION_AND,
[ new EqualsFilter('email',
$email),
new EqualsFilter('salesChannelId',
$context->
getSalesChannel()->
getId()),
]),
);
$criteria->
setLimit(1
);
return $this->newsletterRecipientRepository
->
searchIds($criteria,
$context->
getContext()) ->
firstId();
} /**
* @return array<string, string>
*/
private function getOptionSelection(SalesChannelContext
$context): array
{ return [ self::OPTION_DIRECT =>
$this->
isNewsletterDoi($context) ? self::STATUS_NOT_SET : self::STATUS_DIRECT,
self::OPTION_SUBSCRIBE =>
$this->
isNewsletterDoi($context) ? self::STATUS_NOT_SET : self::STATUS_DIRECT,