@recaptime-dev's working patches + fork for Phorge, a community fork of Phabricator. (Upstream dev and stable branches are at upstream/main and upstream/stable respectively.) hq.recaptime.dev/wiki/Phorge
phorge phabricator
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Create metamta.user-address-format configuration option

Summary: this lets users specify what "name" to use in email addresses

Test Plan: changed the conf setting in my local instance and used phabricator. observed name format changes

Reviewers: epriestley

Reviewed By: epriestley

CC: aran, Korvin

Maniphest Tasks: T1862

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

+35 -1
+8
conf/default.conf.php
··· 320 320 // configuration a little easier. 321 321 'metamta.send-immediately' => true, 322 322 323 + // When email is sent, what format should Phabricator use for user's 324 + // email addresses? Valid values are: 325 + // - 'short' - 'gwashington <gwashington@example.com>' 326 + // - 'real' - 'George Washington <gwashington@example.com>' 327 + // - 'full' - 'gwashington (George Washington) <gwashington@example.com>' 328 + // The default is 'full'. 329 + 'metamta.user-address-format' => 'full', 330 + 323 331 // If you're using Amazon SES to send email, provide your AWS access key 324 332 // and AWS secret key here. To set up Amazon SES with Phabricator, you need 325 333 // to:
+27 -1
src/applications/metamta/storage/PhabricatorMetaMTAMail.php
··· 758 758 case PhabricatorPHIDConstants::PHID_TYPE_USER: 759 759 $user = $users[$phid]; 760 760 if ($user) { 761 - $name = $user->getFullName(); 761 + $name = $this->getUserName($user); 762 762 $is_mailable = !$user->getIsDisabled() 763 763 && !$user->getIsSystemAgent(); 764 764 } ··· 781 781 'mailable' => $is_mailable, 782 782 ); 783 783 } 784 + } 785 + 786 + /** 787 + * Small helper function to make sure we format the username properly as 788 + * specified by the `metamta.user-address-format` configuration value. 789 + */ 790 + private function getUserName($user) { 791 + $format = PhabricatorEnv::getEnvConfig( 792 + 'metamta.user-address-format', 793 + 'full' 794 + ); 795 + 796 + switch ($format) { 797 + case 'short': 798 + $name = $user->getUserName(); 799 + break; 800 + case 'real': 801 + $name = $user->getRealName(); 802 + break; 803 + case 'full': 804 + default: 805 + $name = $user->getFullName(); 806 + break; 807 + } 808 + 809 + return $name; 784 810 } 785 811 786 812 private function filterSendable($value, $phids, $exclude) {