Differential D13142 Diff 31774 src/applications/transactions/editor/PhabricatorApplicationTransactionEditor.php
Changeset View
Changeset View
Standalone View
Standalone View
src/applications/transactions/editor/PhabricatorApplicationTransactionEditor.php
| Show First 20 Lines • Show All 2,133 Lines • ▼ Show 20 Lines | protected function sendMail( | ||||
| // Set this explicitly before we start swapping out the effective actor. | // Set this explicitly before we start swapping out the effective actor. | ||||
| $this->setActingAsPHID($this->getActingAsPHID()); | $this->setActingAsPHID($this->getActingAsPHID()); | ||||
| $mailed = array(); | $mailed = array(); | ||||
| foreach ($targets as $target) { | foreach ($targets as $target) { | ||||
| $original_actor = $this->getActor(); | $original_actor = $this->getActor(); | ||||
| $this->setActor($target->getViewer()); | |||||
| // TODO: Swap locale to viewer locale. | $viewer = $target->getViewer(); | ||||
| $this->setActor($viewer); | |||||
| $locale = PhabricatorEnv::beginScopedLocale($viewer->getTranslation()); | |||||
| $caught = null; | $caught = null; | ||||
| try { | try { | ||||
| // Reload handles for the new viewer. | // Reload handles for the new viewer. | ||||
| $this->loadHandles($xactions); | $this->loadHandles($xactions); | ||||
| $mail = $this->sendMailToTarget($object, $xactions, $target); | $mail = $this->sendMailToTarget($object, $xactions, $target); | ||||
| } catch (Exception $ex) { | } catch (Exception $ex) { | ||||
| $caught = $ex; | $caught = $ex; | ||||
| } | } | ||||
| $this->setActor($original_actor); | $this->setActor($original_actor); | ||||
| unset($locale); | |||||
| if ($caught) { | if ($caught) { | ||||
| throw $ex; | throw $ex; | ||||
| } | } | ||||
| foreach ($mail->buildRecipientList() as $phid) { | foreach ($mail->buildRecipientList() as $phid) { | ||||
| $mailed[$phid] = true; | $mailed[$phid] = true; | ||||
| } | } | ||||
| } | } | ||||
| ▲ Show 20 Lines • Show All 812 Lines • Show Last 20 Lines | |||||