3

Is there a way to configure global email notification preferences in Phabricator?

I know that it allows to manage the preferences per user (https://secure.phabricator.com/book/phabricator/article/mail_rules/#reducing-email), but I'd like to configure default parameters to be inherited by all new user accounts.

Also it would be great if there is ability to update email notification preferences for existing user accounts in a bulk.

5

As an admin, go to your Settings and click Global Settings. Change what you want. These will apply to all new accounts.

2
  • 2
    In my case users have explicitly expressed that they would like to leave the job to the administrator and would prefer to have a common policy for the email notifications. Additionally, they all are on different email servers/clients so using of email rules is not a option here. Would you consider tampering with user_preferences database to be OK? or is there any command line tool in the bin folder that may help in this case? – Sergey Tarasov Dec 3 '14 at 7:10
  • My answer here is two years old. Modern Phabricator has global account settings now. – Chad Little Nov 25 '16 at 20:02
1

To update email preferences for all users in a Phabricator instance:

1.run the following SQL script in mysql console:

use phabricator_user;

/*handle users who haven't customized their preferences yet (replace 'test' with name of your model user)*/
insert into user_preferences(userPHID, preferences) select l.PHID, (select p.preferences from  user u join user_preferences p on (p.userPHID=u.PHID) where   
u.userName = 'test') from user l where not exists(select * from user_preferences r where r.userPHID=l.PHID);

/*change individual parameters for all users*/
update user_preferences set preferences = replace(preferences, '"audit-add-ccs":1', '"audit-add-ccs":2');/*set A commit's subscribers change. to Ignore*/
update user_preferences set preferences = replace(preferences, '"audit-projects":1', '"audit-projects":2');
update user_preferences set preferences = replace(preferences, '"maniphest-priority":1', '"maniphest-priority":2');
update user_preferences set preferences = replace(preferences, '"maniphest-cc":1', '"maniphest-cc":2');
update user_preferences set preferences = replace(preferences, '"maniphest-projects":1', '"maniphest-projects":2');
update user_preferences set preferences = replace(preferences, '"maniphest-unblock":1', '"maniphest-unblock":2');
update user_preferences set preferences = replace(preferences, '"maniphest-column":1', '"maniphest-column":2');
update user_preferences set preferences = replace(preferences, '"maniphest-other":1', '"maniphest-other":2');

/*list current users' preferences*/
select u.phid, u.userName, p.preferences from user u left join user_preferences p on (p.userPhid=u.phid);

2.restart Phabricator daemons and the web server:

./bin/phd restart
service httpd restart

Disclaimer: it worked in my specific case on a specific revision of Phabricator, but it is certainly a "hack" and has a potential to damage user preferences.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.