/**
  *	@covers ::delete
  */
 public function testDelete()
 {
     $mockdb = new \TMT\MockDB();
     $mockdb->expectPrepare("DELETE FROM notificationEmails WHERE guid=:guid");
     $mockdb->expectExecute(array(":guid" => "guid1"));
     $accessor = new NotificationEmail($mockdb);
     $accessor->delete("guid1");
     $mockdb->verify();
 }
Ejemplo n.º 2
0
 public static function init($from, $fromName)
 {
     self::$from = $from;
     self::$fromName = $fromName;
 }
Ejemplo n.º 3
0
 /**
  * Processed if payment is successfully written, send a receipt to the customer
  * and notification to the admin
  * 
  * @see Payment_Extension::onAfterWrite()
  */
 public function onAfterPayment()
 {
     $this->Status = $this->getPaid() ? self::STATUS_PROCESSING : self::STATUS_PENDING;
     $this->PaymentStatus = $this->getPaid() ? 'Paid' : 'Unpaid';
     $this->write();
     ReceiptEmail::create($this->Member(), $this)->send();
     NotificationEmail::create($this->Member(), $this)->send();
     $this->extend('onAfterPayment');
 }
Ejemplo n.º 4
0
 /**
  * Send an order notification to admin if one has not already been sent.
  */
 public function sendNotification()
 {
     if (!$this->NotificationSent) {
         $notification = new NotificationEmail($this->Member(), $this);
         if ($notification->send()) {
             $this->NotificationSent = true;
             $this->write();
         }
     }
 }