aboutsummaryrefslogtreecommitdiff
path: root/classes/Offer.php
diff options
context:
space:
mode:
authorCamil Staps2016-07-31 09:40:25 +0200
committerCamil Staps2016-07-31 09:40:25 +0200
commit1ec8d12a7b125d41ecb723c5d83f2afef95408e9 (patch)
tree4d103ccbab48d2217e1ae13d37c229e4060e9184 /classes/Offer.php
parentGive new files a key (diff)
0.5.2 emails
Diffstat (limited to 'classes/Offer.php')
-rw-r--r--classes/Offer.php26
1 files changed, 26 insertions, 0 deletions
diff --git a/classes/Offer.php b/classes/Offer.php
index 16e0d20..7b0d2fc 100644
--- a/classes/Offer.php
+++ b/classes/Offer.php
@@ -294,6 +294,32 @@ class Offer extends Model{
}
/**
+ * Make a mailer to send about this offer
+ *
+ * @return Mailer The mailer
+ */
+ public function mailer() {
+ $mailer = new Mailer($this->pdo);
+ $mailer->setOffer($this);
+ return $mailer;
+ }
+
+ /**
+ * Send the invoice to the contact
+ *
+ * @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();
+ }
+
+ /**
* Make a new assignment linked to this order
*
* @param string $title The title for this assignment