@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.

Send basic email from new ApplicationTransaction editor

Summary: Ref T2222. Adds basic support for email.

Test Plan: Received an email via `/editpro/`.

Reviewers: btrahan

Reviewed By: btrahan

CC: aran

Maniphest Tasks: T2222

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

+51
+51
src/applications/differential/editor/DifferentialTransactionEditor.php
··· 107 107 return parent::requireCapabilities($object, $xaction); 108 108 } 109 109 110 + protected function shouldSendMail( 111 + PhabricatorLiskDAO $object, 112 + array $xactions) { 113 + return true; 114 + } 115 + 116 + protected function getMailTo(PhabricatorLiskDAO $object) { 117 + $phids = array(); 118 + $phids[] = $object->getAuthorPHID(); 119 + foreach ($object->getReviewerStatus() as $reviewer) { 120 + $phids[] = $reviewer->getReviewerPHID(); 121 + } 122 + return $phids; 123 + } 124 + 125 + protected function getMailSubjectPrefix() { 126 + return PhabricatorEnv::getEnvConfig('metamta.differential.subject-prefix'); 127 + } 128 + 129 + protected function buildReplyHandler(PhabricatorLiskDAO $object) { 130 + return id(new DifferentialReplyHandler()) 131 + ->setMailReceiver($object); 132 + } 133 + 134 + protected function buildMailTemplate(PhabricatorLiskDAO $object) { 135 + $id = $object->getID(); 136 + $title = $object->getTitle(); 137 + 138 + $original_title = $object->getOriginalTitle(); 139 + 140 + $subject = "D{$id}: {$title}"; 141 + $thread_topic = "D{$id}: {$original_title}"; 142 + 143 + return id(new PhabricatorMetaMTAMail()) 144 + ->setSubject($subject) 145 + ->addHeader('Thread-Topic', $thread_topic); 146 + } 147 + 148 + protected function buildMailBody( 149 + PhabricatorLiskDAO $object, 150 + array $xactions) { 151 + 152 + $body = parent::buildMailBody($object, $xactions); 153 + 154 + $body->addTextSection( 155 + pht('REVISION DETAIL'), 156 + PhabricatorEnv::getProductionURI('/D'.$object->getID())); 157 + 158 + return $body; 159 + } 160 + 110 161 protected function supportsSearch() { 111 162 return true; 112 163 }