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 --helpHelp 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.csvOptions
| Option | Value | Help |
|---|---|---|
--user | required | the person: a login or a user id |
--email | required | the person: an address (the account it belongs to, if any) |
--category | required | set, frequency: the category identifier |
--state | required | set, master: on or off |
--frequency | required | frequency: immediate, daily or weekly |
--format | required | export: json (default) or csv |
--output | required | export: write to this file instead of the screen |
--wording | required | the text recorded in the consent log (default: "Changed on the console") |
--source | required | admin (default) or import: import switches a double opt-in category on at once |
--no-mail | set: do not send the confirmation mail of a double opt-in | |
--yes | erase: really erase | |
--json | show, categories: JSON | |
--addresses | show 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 ...).
Related
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.