Skip to the content
Documentation

exp:mailpreferences

No ratings yet

Available since Exponential 6.0.15 (in development, not in a release yet).

Summary

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

Usage

./console exp:mailpreferences [options]
php bin/php/mailpreferences.php [options]
./console exp:mail:preferences [options]

Aliases

exp:mail:preferences

Help

The output of ./console help exp:mailpreferences (the script run with --help), without the standard options:

Usage: bin/php/mailpreferences.php [OPTION]...
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:
  --user=VALUE       the person: a login or a user id
  --email=VALUE      the person: an address (the account it belongs to, if any)
  --category=VALUE   set, frequency: the category identifier
  --state=VALUE      set, master: on or off
  --frequency=VALUE  frequency: immediate, daily or weekly
  --format=VALUE     export: json (default) or csv
  --output=VALUE     export: write to this file instead of the screen
  --wording=VALUE    the text recorded in the consent log (default: "Changed on the console")
  --source=VALUE     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

Options

Option Value Description
--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

Standard options

Every script also takes the standard options of the script framework: --help, --quiet, --siteaccess, --debug, --colors, --no-colors, --logfiles, --no-logfiles, --verbose and --allow-root-user.

Source

bin/php/mailpreferences.php, kernel/private/classes/commands/mailpreferences.php

See also

Generated example: exp:mailpreferences

Added to the reference for Exponential 6.0.15.

Contributors

Comments

Add a comment

Comments are read by a moderator before they appear.