Page MenuHomePhorge

PonderQuestionCreateMailReceiver.php
No OneTemporary

Size
1 KB
Referenced Files
None
Subscribers
None

PonderQuestionCreateMailReceiver.php

<?php
final class PonderQuestionCreateMailReceiver
extends PhabricatorApplicationMailReceiver {
protected function newApplication() {
return new PhabricatorPonderApplication();
}
protected function processReceivedMail(
PhabricatorMetaMTAReceivedMail $mail,
PhutilEmailAddress $target) {
$author = $this->getAuthor();
$title = $mail->getSubject();
if (!strlen($title)) {
$title = pht('New Question');
}
$xactions = array();
$xactions[] = id(new PonderQuestionTransaction())
->setTransactionType(PonderQuestionTitleTransaction::TRANSACTIONTYPE)
->setNewValue($title);
$xactions[] = id(new PonderQuestionTransaction())
->setTransactionType(PonderQuestionContentTransaction::TRANSACTIONTYPE)
->setNewValue($mail->getCleanTextBody());
$question = PonderQuestion::initializeNewQuestion($author);
$content_source = $mail->newContentSource();
$editor = id(new PonderQuestionEditor())
->setActor($author)
->setContentSource($content_source)
->setContinueOnNoEffect(true);
$xactions = $editor->applyTransactions($question, $xactions);
$mail->setRelatedPHID($question->getPHID());
}
}

File Metadata

Mime Type
text/x-php
Expires
Tue, May 13, 1:06 PM (1 d, 23 h)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
121410
Default Alt Text
PonderQuestionCreateMailReceiver.php (1 KB)

Event Timeline