diff options
Diffstat (limited to 'classes/Payment.php')
-rw-r--r-- | classes/Payment.php | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/classes/Payment.php b/classes/Payment.php index 4b8c12b..64b65ae 100644 --- a/classes/Payment.php +++ b/classes/Payment.php @@ -68,4 +68,28 @@ class Payment extends Model { return parent::mutator($key, $value); } } + + /** + * Make a mailer to send about this payment + * + * @return Mailer The mailer + */ + public function mailer() { + $mailer = new Mailer($this->pdo); + $mailer->setOffer($this->getOffer()); + + $mailer->Subject = 'Your invoice has been paid'; + $mailer->Body = Correspondence::__r('mail-offer-paid', $this->getOffer()->getContact()->language, $this); + + return $mailer; + } + + /** + * Send the payment notification to the offer's contact + * + * @return bool The result of Mailer::send + */ + public function send() { + return $this->mailer()->send(); + } } |