Model/ResourceModel/Consent.php
public function deleteConsentByEmails($emails)
    {
        if (empty($emails)) {
            return [];
        }
        $collection = $this->consentCollectionFactory->create();
        $collection->getSelect()
            ->joinInner(
                ['c' => $this->getTable(Schema::EMAIL_CONTACT_TABLE)],
                "c.email_contact_id = main_table.email_contact_id",
                []
            );

        $collection->addFieldToFilter('c.email', ['in' => $emails]);

        return $collection->walk('delete');
    }
public function deleteConsentByEmails($emails)
    {
        if (empty($emails)) {
            return [];
        }
        $collection = $this->consentCollectionFactory->create();
        $collection->getSelect()
            ->joinInner(
                ['c' => $this->getTable(Schema::EMAIL_CONTACT_TABLE)],
                "c.email_contact_id = main_table.email_contact_id",
                []
            );

        $collection->addFieldToFilter('c.email', ['in' => $emails]);

        return $collection->walk('delete');
    }
public function deleteConsentByEmails ( $ emails ) { if ( empty ( $ emails ) ) { return [ ] ; } $ collection = $ this -> consentCollectionFactory -> create ( ) ; $ collection -> getSelect ( ) -> joinInner ( [ 'c' => $ this -> getTable ( Schema :: EMAIL_CONTACT_TABLE ) ] , "c.email_contact_id = main_table.email_contact_id" , [ ] ) ; $ collection -> addFieldToFilter ( 'c.email' , [ 'in' => $ emails ] ) ; return $ collection -> walk ( 'delete' ) ; }
Delete Consent for contact.

@param array $emails
@return array
Delete Consent for contact .