Search by

hryvinskyi / magento2-gdpr-frontend

hryvinskyi

Storefront pages of the GDPR data-subject rights suite: My Account Privacy Settings, the guest request form, the confirm and cancel pages of guest e-mails, the archive download, and the storefront links of its e-mails

Package info

github.com/hryvinskyi/magento2-gdpr-frontend

Type:magento2-module

pkg:composer/hryvinskyi/magento2-gdpr-frontend

Statistics

Installs: 1

Dependents: 2

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:27 UTC


README

The storefront half of the data-subject rights suite: a Privacy Settings page in the customer account, a request form for shoppers without an account, the pages behind the links in the suite's e-mails, and the download of an export archive. It implements no rule of its own. It calls the services of hryvinskyi/magento2-gdpr, and it provides the storefront links that package's e-mails print.

What it does for a store

  • My Account › Privacy Settings (gdpr/privacy). A signed-in customer sees their requests with status and dates, can request a copy of their data, ask to delete or anonymise the account (the account's password and a confirmation box are required), and cancel a waiting request. A signed-in session and the form key are required for every action. The page, its navigation link and the download are offered by the store view the account belongs to, which is the store view that accepts or refuses the customer's requests, whichever store view the customer browses. The warning before an erase or an anonymise tells the delay the request will get, from the account's website. A download streams the export archive straight to the signed-in customer and issues no link. A failed request is shown as one that could not be completed, and only a request that still waits can be cancelled. A locked account is signed out and sent to the login page with the reason.
  • A request form for guests (gdpr/guest, linked as Privacy requests from the footer while the store view offers it, that is while both the privacy features and the guests' requests are on). The shopper enters the order number, the order's e-mail address, the billing last name or postcode, and the request type. A matching and a non-matching claim lead to the same page, and a refused claim keeps only the order number and e-mail address for the form.
  • Pages for the e-mailed links (gdpr/guest/confirm, gdpr/guest/cancel). The link's token is kept in the visitor's session and the browser goes on to an address without it. That page names the request (its type and when it was made) and offers one button; the post confirms or cancels the request. A link that is not valid shows one message whatever the reason.
  • The download link of an archive (gdpr/export/download), from the "export ready" e-mail, for customers and guests alike. A valid token streams the ZIP as a private attachment, and any other answers page not found, in a page no cache keeps.
  • Storefront links for the e-mails. The package provides the privacy page, the guest confirm and cancel pages and the archive download, each built for the request's store view. Without it the suite's e-mails carry no link.
  • Private by construction. Every guest page, redirect and download is kept out of search engines (noindex, nofollow) and out of caches, sends no Referer, and is not full-page cached. The pages stay available through a link even after a store view turned the guest form off.
  • Failures are logged with ids only. A storefront failure is written to the GDPR log channel with the exception's class and code and never a message.

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, hryvinskyi/magento2-gdpr ^1.0 and hryvinskyi/magento2-document-export ^1.0.
  • The platform's Store, Customer and Theme 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-frontend
bin/magento module:enable Hryvinskyi_GdprApi Hryvinskyi_Clock Hryvinskyi_RateLimit Hryvinskyi_DocumentExport Hryvinskyi_Logger Hryvinskyi_Gdpr Hryvinskyi_GdprFrontend
bin/magento setup:upgrade
bin/magento setup:di:compile  # production mode only
bin/magento setup:static-content:deploy -f  # production mode only
bin/magento cache:flush

Verify on the storefront: sign in as a customer and open My Account. The navigation lists Privacy Settings, and the page says You have not made any privacy request yet. The footer lists Privacy requests.

Configuration

None of its own. The package reads two settings of the core, both settable down to a store view. A customer's pages follow the store view the account belongs to; a guest's pages follow the store view the guest browses.

Path Default Effect
hryvinskyi_gdpr/general/enabled 1 Offers Privacy Settings to a customer when it is on for the store view the account belongs to, and allows the guest form in the store view the guest browses.
hryvinskyi_gdpr/requests/guest_enabled 1 Shows the footer link and allows the guest form.

The delay, the confirmation window, the guest limits, the formats and the e-mails are settings of the core and are described in its README.

Limits

  • Deleting or anonymising an account from the Privacy Settings page asks for the account's password. A customer who signed up without one, through a social login for example, sets a password first (My Account › Account Information, or the "Forgot your password?" link) and then sends the request.
  • The guest rate limit counts per client address and per order number. Behind a proxy that does not pass the client address on, every shopper has the proxy's address and shares one limit, so a few attempts can lock every guest out. Configure the trusted proxy and the forwarded header the store uses, so Magento reports the real client address (the alternativeHeaders argument, and trustedProxies where the installed Magento has it, of Magento\Framework\HTTP\PhpEnvironment\RemoteAddress).
  • A guest can ask only for an order the store's own records show: its number, e-mail address and billing last name or postcode must match. A guest without an order cannot make a request through this form.
  • An export is carried out by cron, so the e-mail with the download link arrives after the next run, not at once.
  • The confirm, cancel and download pages of a guest's links answer in every store view, so a link in an e-mail keeps working when the store view later turns the guest form off. The guest form itself shows only where the privacy features and guest requests are both on.

Registrations

Where What
Storefront route frontName gdpr: privacy/index, privacy/export, privacy/erase, privacy/cancel, privacy/download, guest/index, guest/submit, guest/sent, guest/confirm, guest/cancel, export/download.
Preference Hryvinskyi\GdprApi\Api\SubjectLinksInterface → Hryvinskyi\GdprFrontend\Model\Links\StorefrontSubjectLinks
Layout handles gdpr_privacy_index, gdpr_guest_index, gdpr_guest_sent, gdpr_guest_page, gdpr_guest_confirm, gdpr_guest_confirm_form, gdpr_guest_confirm_done, gdpr_guest_cancel, gdpr_guest_cancel_form, gdpr_guest_cancel_done, gdpr_guest_link_invalid, and additions to customer_account and default
Templates privacy/settings.phtml, guest/form.phtml, guest/sent.phtml, guest/link-form.phtml, guest/confirmed.phtml, guest/cancelled.phtml, guest/link-invalid.phtml
Session A session namespace hryvinskyi_gdpr_guest holds the guest's pending link tokens and the claim form's values.

The package registers no cron job, command, e-mail template or ACL resource.

Extension points

None of its own. A store that wants other URLs or its own pages replaces the SubjectLinksInterface preference in its own di.xml with a class that returns them; the e-mails of the core then print the new links.

<preference for="Hryvinskyi\GdprApi\Api\SubjectLinksInterface" type="Vendor\Module\Model\Links\CustomSubjectLinks"/>

Tests

Run from the Magento root.

  • Unit: vendor/bin/phpunit -c app/code/Hryvinskyi/GdprFrontend/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/GdprFrontend/Test/Integration.
  • Browser flows: Test/E2e/, run with the @hryvinskyi/magento2-e2e package from the shop's e2e/ directory (npm test there). The customer flow signs up a fresh account; the guest flow places a test order and reads the confirmation e-mail from a captured mailbox. The confirmation e-mail leaves through the shop's cron job, and a local environment runs no cron: set E2E_CRON_COMMAND to the shell command that runs the job once (for a ddev project, ddev exec bin/magento cron:run --group=hryvinskyi_gdpr) and the spec runs it before it waits for the e-mail. With the variable unset the spec waits up to three minutes for the store's own cron.
  • Static analysis: PHPStan 2.x at level 10 with the package's phpstan.neon.dist (phpstan analyse -c app/code/Hryvinskyi/GdprFrontend/phpstan.neon.dist --level=10), and vendor/bin/phpcs --standard=app/code/Hryvinskyi/GdprFrontend/phpcs.xml.dist app/code/Hryvinskyi/GdprFrontend.

Translations

The storefront wording ships 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.