diff options
author | Camil Staps | 2016-08-01 00:08:05 +0200 |
---|---|---|
committer | Camil Staps | 2016-08-01 00:08:05 +0200 |
commit | 3f28c67f9372387f3a5bc45d5352499d6f919afc (patch) | |
tree | 75f359a414b8f60236925cd6da3932dd582db256 /classes/Payment.php | |
parent | Easier emails (diff) |
Payment confirmation
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(); + } } |