From 72766ab34d4b36cf38eb0062dc7bc17db8f72998 Mon Sep 17 00:00:00 2001 From: Camil Staps Date: Mon, 1 Aug 2016 08:40:38 +0200 Subject: Internationalisation: email subjects --- classes/Correspondence.php | 6 ++++++ classes/Offer.php | 5 +++-- classes/Payment.php | 5 +++-- 3 files changed, 12 insertions(+), 4 deletions(-) diff --git a/classes/Correspondence.php b/classes/Correspondence.php index e2a0771..3a9996d 100644 --- a/classes/Correspondence.php +++ b/classes/Correspondence.php @@ -106,9 +106,15 @@ class Correspondence extends FPDF { 'vat' => [ 'en' => 'VAT', 'nl' => 'BTW'], + 'mail-offer-subject' => [ + 'en' => 'Your invoice', + 'nl' => 'Uw factuur'], 'mail-offer' => [ 'en' => "Dear {{getContact-name}},\r\n\r\nPlease find attached your invoice. You can either pay by bank transfer, as indicated on the invoice, or using Paypal or a credit card on {{getPaymentUrl}}.\r\n\r\nThank you in advance,\r\n\r\n{{{invoice_name}}}", 'nl' => "Beste {{getContact-name}},\r\n\r\nBijgevoegd vindt u uw factuur. U kunt per bankoverschrijving betalen, zoals aangegeven op de factuur, of met Paypal of een credit card op {{getPaymentUrl}}.\r\n\r\nAlvast hartelijk dank,\r\n\r\n{{{invoice_name}}}"], + 'mail-offer-paid-subject' => [ + 'en' => 'Your invoice has been paid', + 'nl' => 'Uw factuur is betaald'], 'mail-offer-paid' => [ 'en' => "Dear {{getOffer-getContact-name}},\r\n\r\nYour invoice at {{getOffer-getPaymentUrl}} has been paid.\r\n\r\nThank you,\r\n\r\n{{{invoice_name}}}", 'nl' => "Beste {{getOffer-getContact-name}},\r\n\r\nUw factuur op {{getOffer-getPaymentUrl}} is betaald.\r\n\r\nHartelijk dank,\r\n\r\n{{{invoice_name}}}"], diff --git a/classes/Offer.php b/classes/Offer.php index 202c0e8..23b1190 100644 --- a/classes/Offer.php +++ b/classes/Offer.php @@ -276,9 +276,10 @@ class Offer extends Model{ $mailer = new Mailer($this->pdo); $mailer->setOffer($this); + $lang = $this->getContact()->language; $mailer->addAttachment($this->getInvoiceFile()->getFilenamePath()); - $mailer->Subject = 'Your invoice'; - $mailer->Body = Correspondence::__r('mail-offer', $this->getContact()->language, $this); + $mailer->Subject = Correspondence::__('mail-offer-subject', $lang); + $mailer->Body = Correspondence::__r('mail-offer', $lang, $this); return $mailer; } diff --git a/classes/Payment.php b/classes/Payment.php index bab55be..59dde87 100644 --- a/classes/Payment.php +++ b/classes/Payment.php @@ -49,8 +49,9 @@ class Payment extends Model { $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); + $lang = $this->getOffer()->getContact()->language; + $mailer->Subject = Correspondence::__('mail-offer-paid-subject', $lang); + $mailer->Body = Correspondence::__r('mail-offer-paid', $lang, $this); return $mailer; } -- cgit v1.2.3