Search by

hryvinskyi / magento2-gdpr-newsletter

hryvinskyi

Newsletter subscriptions as a data-subject entity: exported and deleted with the shopper's other personal data

Package info

github.com/hryvinskyi/magento2-gdpr-newsletter

Type:magento2-module

pkg:composer/hryvinskyi/magento2-gdpr-newsletter

Statistics

Installs: 1

Dependents: 1

Suggesters: 0

Stars: 0

Open Issues: 0

1.0.0 2026-11-30 18:52 UTC

This package is auto-updated.

Last update: 2026-11-30 20:09:26 UTC


README

Adds newsletter subscriptions to the data-subject requests of hryvinskyi/magento2-gdpr. It contributes through di.xml only. The engine never names this package.

What it does for a store

  • Which subscriptions a subject covers. A customer subject covers the subscription tied to its account. A guest subject covers the subscriptions of its e-mail address (any letter case) that belong to no account and sit in the stores of its website, and those whose store view was deleted, which belong to every website. A subject never covers the subscriptions of the other kind of subject, even when they share the address.
  • Export. One section, newsletter_subscriber, lists each subscription's e-mail address, its status in words (Subscribed, Not Activated, Unsubscribed or Unconfirmed), the store's name and the date the status last changed.
  • Delete only. An erase or an anonymise request removes the subscription rows. There is nothing to anonymise: the row is the address, so the entity has no anonymiser, and an anonymise request deletes it.

Requirements

  • Magento Open Source or Adobe Commerce 2.4.8 or 2.4.9, PHP 8.3 to 8.5.
  • hryvinskyi/magento2-gdpr-api ^1.0 and hryvinskyi/magento2-gdpr ^1.0.
  • The platform's Store and Newsletter modules.

Installation

Run from the Magento root. hryvinskyi/magento2-gdpr-pack installs this package with the rest of the suite.

composer require hryvinskyi/magento2-gdpr-newsletter
bin/magento module:enable Hryvinskyi_GdprApi Hryvinskyi_Clock Hryvinskyi_RateLimit Hryvinskyi_DocumentExport Hryvinskyi_Logger Hryvinskyi_Gdpr Hryvinskyi_GdprNewsletter
bin/magento setup:upgrade
bin/magento setup:di:compile  # production mode only
bin/magento cache:flush

Verify with a dry-run plan. It changes nothing.

bin/magento gdpr:erase --email=<address> --website=<website_id> --guest --dry-run

The output lists newsletter_subscriber with delete and the number of subscriptions the address holds.

Configuration

None of its own. The entity code is newsletter_subscriber, its sort order is 300, its method is always delete, and it has no field to anonymise. The core's erasure rules need no entry for it.

Stored data

The package creates no table. It reads and deletes rows of newsletter_subscriber.

Limits

  • Only the subscription rows of the store are removed. An address a store copied elsewhere (to a mailing service, say) is removed there by hand.
  • A subscription tied to an account is the customer's. A subscription of the same address that belongs to no account is the guest's. An operator makes one request for each.

Registrations

Where What
providers of Hryvinskyi\Gdpr\Model\Entity\EntityProviderPool newsletter_subscriber, Hryvinskyi\GdprNewsletter\Model\Provider\SubscriptionProvider

The package registers no route, command, cron job, event, plugin or preference.

Extension point

None of its own. It is an example of a delete-only provider: a virtual type of Hryvinskyi\Gdpr\Model\Entity\EntityProvider with a description, an exporter and a deleter, added to the pool. The core's README shows the registration.

Tests

Run from the Magento root.

  • Unit: vendor/bin/phpunit -c app/code/Hryvinskyi/GdprNewsletter/phpunit.xml.dist.
  • Integration: the platform's harness in dev/tests/integration, against its own database, one run at a time. cd dev/tests/integration && php -d memory_limit=4G ../../../vendor/bin/phpunit -c phpunit.xml ../../../app/code/Hryvinskyi/GdprNewsletter/Test/Integration.
  • Static analysis: PHPStan 2.x at level 10 with the package's phpstan.neon.dist (phpstan analyse -c app/code/Hryvinskyi/GdprNewsletter/phpstan.neon.dist --level=10), and vendor/bin/phpcs --standard=app/code/Hryvinskyi/GdprNewsletter/phpcs.xml.dist app/code/Hryvinskyi/GdprNewsletter.

Translations

The labels the package shows in exports ship in en_US and 25 more locales: the official languages of the European Union, Norwegian Bokmål and Ukrainian. The translations are machine-made; have them read by a native speaker before a store relies on them, and override a phrase in a theme or a language pack.