diff options
Diffstat (limited to 'classes/Offer.php')
-rw-r--r-- | classes/Offer.php | 22 |
1 files changed, 15 insertions, 7 deletions
diff --git a/classes/Offer.php b/classes/Offer.php index 7b0d2fc..2a48604 100644 --- a/classes/Offer.php +++ b/classes/Offer.php @@ -87,6 +87,15 @@ class Offer extends Model{ } /** + * Get the URL on which the offer can be paid + * + * @return string The URL + */ + public function getPaymentUrl() { + return Constants::url_external . "pay?id={$this->id}&key={$this->payment_key}"; + } + + /** * Get the contact that this offer is linked to * * @return contact The contact @@ -301,6 +310,11 @@ class Offer extends Model{ public function mailer() { $mailer = new Mailer($this->pdo); $mailer->setOffer($this); + + $mailer->addAttachment($this->getInvoiceFile()->getFilenamePath()); + $mailer->Subject = 'Your invoice'; + $mailer->Body = Correspondence::__r('mail-offer', $this->getContact()->language, $this); + return $mailer; } @@ -310,13 +324,7 @@ class Offer extends Model{ * @return bool The result of Mailer::send */ public function send() { - $mailer = $this->mailer(); - - $mailer->addAttachment($this->getInvoiceFile()->getFilenamePath()); - $mailer->Subject = 'Your invoice'; - $mailer->Body = 'Here is your invoice.'; - - return $mailer->send(); + return $this->mailer()->send(); } /** |