Skip to the content
Documentation
Help Start
Reading in:
  • German: 9,059 of 9,059 pages
About the help in other languages
All help pages

exp:mailpreferences

Show and change the e-mail preferences of a user or an address: categories, master switch, frequency, export, erase.

Download as PDF

Address: https://doc.exponential.earth/exphelp/viewer/examples/commands/mailpreferences.md

On this page

exp:mailpreferences

Show and change the e-mail preferences of a user or an address: categories, master switch, frequency, export, erase.

Script bin/php/mailpreferences.php, code in kernel/private/classes/commands/mailpreferences.php. Run it from the installation root, as the user the web server runs as:

./console exp:mailpreferences --help
./console exp:mail:preferences --help
php bin/php/mailpreferences.php --help

Help text

E-mail preferences of one person
  categories                the categories (identifier, essential/optional, default, frequencies, double opt-in)
  show                      the person's master switch, categories, frequencies, suppression, pending confirmations
  set                       switch a category on or off (--category, --state=on|off)
  frequency                 the frequency of a category (--category, --frequency=immediate|daily|weekly)
  master                    the master switch "all optional mail" (--state=on|off)
  export                    everything stored about the person, JSON or CSV (--format, --output)
  erase                     remove the preferences, anonymise the consent log (--yes)
  link                      print the person's preference link (works without login)
Every change is written to the consent log with source admin (or --source=import for consent
confirmed elsewhere) and the wording of --wording. Addresses are hidden unless --addresses.

./console exp:mail:preferences show --user=editor
./console exp:mail:preferences set [email protected] --category=newsletter --state=on --no-mail
./console exp:mail:preferences master --user=14 --state=off
./console exp:mail:preferences export --user=editor --format=csv --output=var/tmp/editor.csv

Options

OptionValueHelp
--userrequiredthe person: a login or a user id
--emailrequiredthe person: an address (the account it belongs to, if any)
--categoryrequiredset, frequency: the category identifier
--staterequiredset, master: on or off
--frequencyrequiredfrequency: immediate, daily or weekly
--formatrequiredexport: json (default) or csv
--outputrequiredexport: write to this file instead of the screen
--wordingrequiredthe text recorded in the consent log (default: "Changed on the console")
--sourcerequiredadmin (default) or import: import switches a double opt-in category on at once
--no-mailset: do not send the confirmation mail of a double opt-in
--yeserase: really erase
--jsonshow, categories: JSON
--addressesshow the address instead of hiding it

Read from the option definitions in the code (startup(), getOptions(), options() or ezcConsoleOption). Every script also takes the standard options of the script framework (--help, --siteaccess, --debug, --quiet, --allow-root-user ...).


Generated by ./console exp:help:examples from bin/php/mailpreferences.php, kernel/private/classes/commands/mailpreferences.php. Do not edit this page: change the source and generate again (how). Free documentation: GFDL 1.3 or later.

Something wrong on this page? Report an error

Documentation license

This documentation is free documentation, licensed under the GNU Free Documentation License 1.3 or later.

Exponential Copyright © 1998-2026 Exponential Foundation and 7x