Log in
Model

Subscriber

Magento\Newsletter\Model\Subscriber

What it does

This class manages newsletter subscribers in Magento 2, handling subscription operations like subscribing, unsubscribing, and confirming email subscriptions.

Developers use it to programmatically manage newsletter subscriptions, send confirmation/unsubscription emails, and track subscriber status changes.

It supports both guest and customer subscriptions with various status states (subscribed, unconfirmed, unsubscribed, not active).

Public Methods

  • getId()
  • setId()
  • getCode()
  • getConfirmationLink()
  • getUnsubscriptionLink()
  • setCode()
  • getStatus()
  • setStatus()
  • setMessagesScope()
  • getEmail()
  • setEmail()
  • setStatusChanged()
  • isStatusChanged()
  • isSubscribed()
  • loadBySubscriberEmail()
  • loadByCustomer()
  • randomSequence()
  • unsubscribe()
  • confirm()
  • received()
  • sendConfirmationRequestEmail()
  • sendConfirmationSuccessEmail()
  • sendUnsubscriptionEmail()
  • getSubscriberFullName()
  • beforeSave()
  • loadByEmail()
  • loadByCustomerId()
  • subscribe()
  • subscribeCustomerById()
  • unsubscribeCustomerById()
  • updateSubscription()