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()); } }