Homec4science

Fix several issues with email-related global preferences

Authored by epriestley <git@epriestley.com> on Jun 14 2016, 20:49.

Description

Fix several issues with email-related global preferences

Summary:
Ref T11098. Mixture of issues here:

  • Similar problem to D16112, where users with no settings at all could fail to fall back to the global defaults.
    • I made UserPreferencesQuery responsible for building defaults instead to simplify this, since we have 4 or 5 callsites which need to do it and they aren't easily reducible.
  • Handle cases where metamta.one-mail-per-recipient is off (and thus users can not have any custom settings) more explicitly.
  • When metamta.one-mail-per-recipient is off, remove the "Email Format" panel for users only -- administrators can still access it in global preferences.

Test Plan:

  • Deleted a user's preferences, changed globals, purged cache, made sure defaults reflected global defaults.
  • Changed global mail tags, sent mail to the user, verified it was dropped in accordinace with global settings.
  • Changed user's settings to get the mail instead, verified mail was sent.
  • Toggled user's Re / Vary settings, verified mail subject lines reflected user settings.
  • Disabled metamta.one-mail-per-recipient, verified user "Email Format" panel vanished.
  • Edited "Email Format" in single-mail-mode in global prefs as an administrator.
  • Sent more mail, verified mail respected new global settings.

Reviewers: chad

Reviewed By: chad

Maniphest Tasks: T11098

Differential Revision: https://secure.phabricator.com/D16118

Details

Committed
epriestley <git@epriestley.com>Jun 14 2016, 21:35
Pushed
aubortJan 31 2017, 17:16
Parents
rPHcb7560d30172: Remove "re prefix" and "vary subjects" config
Branches
Unknown
Tags
Unknown

Event Timeline

epriestley <git@epriestley.com> committed rPH2e450212503e: Fix several issues with email-related global preferences (authored by epriestley <git@epriestley.com>).Jun 14 2016, 21:35