61 \
Magento\Framework\Stdlib\DateTime\DateTime $date,
77 $this->
_init(
'newsletter_subscriber',
'subscriber_id');
78 $this->_subscriberLinkTable = $this->
getTable(
'newsletter_queue_link');
90 $this->_messagesScope = $scope;
101 $select = $this->connection->select()->from($this->
getMainTable())->where(
'subscriber_email=:subscriber_email');
103 $result = $this->connection->fetchRow(
$select, [
'subscriber_email' => $subscriberEmail]);
123 ->where(
'customer_id=:customer_id and store_id=:store_id');
141 ->where(
'subscriber_email=:subscriber_email and store_id=:store_id');
147 'subscriber_email' =>
$customer->getEmail(),
166 return $this->mathRandom->getUniqueHash();
179 $this->connection->beginTransaction();
181 $data[
'letter_sent_at'] = $this->_date->gmtDate();
182 $this->connection->update(
183 $this->_subscriberLinkTable,
187 $this->connection->commit();
188 }
catch (\Exception $e) {
189 $this->connection->rollBack();
190 throw new \Magento\Framework\Exception\LocalizedException(
__(
'We cannot mark as received subscriber.'));
__construct(\Magento\Framework\Model\ResourceModel\Db\Context $context, \Magento\Framework\Stdlib\DateTime\DateTime $date, \Magento\Framework\Math\Random $mathRandom, $connectionName=null)
_init($mainTable, $idFieldName)
loadByEmail($subscriberEmail)
loadByCustomerData(\Magento\Customer\Api\Data\CustomerInterface $customer)
received(\Magento\Newsletter\Model\Subscriber $subscriber, \Magento\Newsletter\Model\Queue $queue)