customer:anonymize
Description
Erase the identifying data of a customer, keeping the accounting record of the orders.
Usage
customer:anonymize <email> [options]
Arguments
emailEmail address of the customer to anonymize.
Options
--forceDo not ask for confirmation.
Deleting an account would take away orders a business is required to keep. This command
erases the identity instead: name, email, password, tokens, address book, cart addresses,
the identity frozen on the order addresses (including SIRET and VAT number), carts,
newsletter subscription, account version history, and the identity copied into the admin
log. The orders keep their reference, invoice number and date, amounts, taxes, coupons and
status history, and stay attached to the now anonymous account. The account goes back to the
default customer group, and CUSTOMER_GROUP_CHANGED is
dispatched once the erasure is committed. The orders keep the group frozen on them.
The whole operation runs in a single Propel transaction: if a module fails, nothing is
written. customer.anonymized_at records the date of the first erasure, so running the
command twice does not move the date.
Modules erase their own share by implementing CustomerPersonalDataProviderInterface. See
Personal data.
Examples
Ask for confirmation, then anonymize:
php Thelia customer:anonymize customer@example.com
From a script, without the prompt:
php Thelia customer:anonymize customer@example.com --force
This cannot be undone. The account is disabled and its email is replaced by
anonymous-<id>@anonymous.invalid, so the person cannot log in again nor be found by
email.