', 20602);
// Update order status
$processor->UpdateOrderStatus(7);
// Continue processing
$processor->mContinueNow = true;
// Audit
$processor->CreateAudit('PsShipOk finished.', 20601);
}
}
?>
When this pipeline stage finishes, processing moves straight on to PsFinalNotification.
PsFinalNotification
This last pipeline section is very similar to the first, because it sends an e-mail to the customer.
This time, we??™re confirming that the order has shipped. Add the following code to a new file in
the business folder named ps_final_notification.php:
class PsFinalNotification implements IPipelineSection
{
private $_mProcessor;
public function Process($processor)
{
// Set processor reference
$this->_mProcessor = $processor;
// Audit
$processor->CreateAudit('PsFinalNotification started.', 20700);
// Send mail to customer
$processor->MailCustomer(STORE_NAME . ' order dispatched.',
$this->GetMailBody());
CHAPTER 19 ?– IMPLEMENTING THE ORDER PIPELINE: PART 2 601
// Audit
$processor->CreateAudit('Dispatch e-mail send to customer.', 20702);
// Update order status
$processor->UpdateOrderStatus(8);
// Audit
$processor->CreateAudit('PsFinalNotification finished.', 20701);
}
It uses a familiar-looking GetMailBody() method to build the body of the e-mail:
private function GetMailBody()
{
$body = 'Your order has now been dispatched! ' .
Pages:
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720