3 final class PhabricatorNotificationTestController
4 extends PhabricatorNotificationController
{
6 public function handleRequest(AphrontRequest
$request) {
7 $viewer = $request->getViewer();
9 if ($request->validateCSRF()) {
11 'This is a test notification, sent at %s.',
12 phabricator_datetime(time(), $viewer));
14 // NOTE: Currently, the FeedStoryPublisher explicitly filters out
15 // notifications about your own actions. Send this notification from
16 // a different actor to get around this.
17 $application_phid = id(new PhabricatorNotificationsApplication())
22 $xactions[] = id(new PhabricatorUserTransaction())
24 PhabricatorUserNotifyTransaction
::TRANSACTIONTYPE
)
25 ->setNewValue($message_text)
26 ->setForceNotifyPHIDs(array($viewer->getPHID()));
28 $editor = id(new PhabricatorUserTransactionEditor())
30 ->setActingAsPHID($application_phid)
31 ->setContentSourceFromRequest($request);
33 $editor->applyTransactions($viewer, $xactions);
36 return id(new AphrontAjaxResponse());