/** * @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(); }
public static function init($from, $fromName) { self::$from = $from; self::$fromName = $fromName; }
/** * 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'); }
/** * 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(); } } }