".
+ $signature
+ );
$this->mailer->send($message);
return new DataResponse("", 200, ['Content-Type' => 'application/json']);
// } catch (Exception $e) {
@@ -1602,6 +1614,14 @@ class PageController extends Controller {
// }
}
}
+ public function addSignatureEmailLogo (){
+ $signatureImage = $this->getSignature();
+ if (!$signatureImage) {
+ return "";
+ }
+ //Add html img in base 64
+ return "" ;
+ }
/**
* @NoAdminRequired
@@ -1852,6 +1872,17 @@ class PageController extends Controller {
return base64_encode($file->getContent());
}
+ private function getSignature(){
+ try{
+ if(isset($this->adminStorage)){
+ $file = $this->adminStorage->get('/.gestion/sign.jpg');
+ return $file->getContent();
+ }
+ }
+ catch(\OCP\Files\NotFoundException $e) {}
+
+ return false;
+ }
/**
* @NoAdminRequired
@@ -2277,7 +2308,7 @@ class PageController extends Controller {
if($ff_pdf != null && trim($email) != ''){
//send email
- $this->sendAttachmentToClientByDefunt($defunt->id, $ff_pdf, $email,"Rapport soins", "Veuillez trouver ci-joint le rapport de soins de ".$nomDefunt.".");
+ $this->sendAttachmentToClientByDefunt($defunt->id, $ff_pdf, $email,"Rapport soins", "Vous trouverez en pièce jointe le rapport de soins de ".$nomDefunt.".");
}
$res = array();
@@ -2471,7 +2502,7 @@ class PageController extends Controller {
if($ff_pdf != null && trim($email) != ''){
//send email
- $this->sendAttachmentToClientByDefunt($defunt->id, $ff_pdf, $email,"Rapport des bijoux", "Veuillez trouver ci-joint le rapport des bijoux de ".$nomDefunt.".");
+ $this->sendAttachmentToClientByDefunt($defunt->id, $ff_pdf, $email,"Rapport des bijoux", "Vous trouverez en pièce jointe le rapport des bijoux de ".$nomDefunt.".");
}
$res = array();
@@ -2687,7 +2718,7 @@ class PageController extends Controller {
$careCertificateFilename = $this->certificateService->generateCareCertificate($defuntId,$this->idNextcloud);
if($careCertificateFilename != null && trim($email) != '' ){
//send email
- $this->sendAttachmentToClientByDefunt($defuntId, $careCertificateFilename, $email,"Attestation de soins", " Veuillez trouver ci-joint l'attestation de soins ", true);
+ $this->sendAttachmentToClientByDefunt($defuntId, $careCertificateFilename, $email,"Attestation de soins", " Vous trouverez en pièce jointe l'attestation de soins ", true);
}
return $careCertificateFilename;
}
@@ -2836,7 +2867,7 @@ class PageController extends Controller {
$careCertificateFilename = $this->certificateService->generatePacemakerCertificate($defuntId,$this->idNextcloud);
if($careCertificateFilename != null && trim($email) != ''){
//send email
- $this->sendAttachmentToClientByDefunt($defuntId, $careCertificateFilename, $email,"Attestation pacemaker", "Veuillez trouver ci-joint l'attestation de pacemaker ", true);
+ $this->sendAttachmentToClientByDefunt($defuntId, $careCertificateFilename, $email,"Attestation pacemaker", "Vous trouverez en pièce jointe l'attestation de pacemaker ", true);
}
return $careCertificateFilename;
diff --git a/gestion/lib/Helpers/DateHelpers.php b/gestion/lib/Helpers/DateHelpers.php
index 0f58ad2..67de497 100644
--- a/gestion/lib/Helpers/DateHelpers.php
+++ b/gestion/lib/Helpers/DateHelpers.php
@@ -131,5 +131,13 @@ class DateHelpers
}
return $totalHours;
}
+ public static function convertInvoiceDateToMonthAndYearOnly($invoiceDate = null){
+ if(!$invoiceDate){
+ return "";
+ }
+ $dateTime = new DateTime($invoiceDate);
+ $formattedDate = strftime('%B %Y', $dateTime->getTimestamp());
+ return $formattedDate;
+ }
}
diff --git a/gestion/lib/Service/MailerService.php b/gestion/lib/Service/MailerService.php
new file mode 100644
index 0000000..f064825
--- /dev/null
+++ b/gestion/lib/Service/MailerService.php
@@ -0,0 +1,68 @@
+
+ *
+ * @author Anna Larch
+ * @author Richard Steinmetz
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU AFFERO GENERAL PUBLIC LICENSE
+ * License as published by the Free Software Foundation; either
+ * version 3 of the License, or any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU AFFERO GENERAL PUBLIC LICENSE for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public
+ * License along with this library. If not, see .
+ *
+ */
+
+namespace OCA\Gestion\Service;
+
+use OCA\Gestion\Constants\BddConstant;
+use OCP\Files\IRootFolder;
+
+class MailerService {
+
+ private $adminStorage;
+
+ public function __construct(
+ IRootFolder $rootFolder,
+ ){
+ $this->adminStorage = $rootFolder->getUserFolder(BddConstant::DEFAULT_ADMIN_ID_NEXTCLOUD);
+ }
+ public function getFooterContent ($userName = "Johann"){
+ $wish = "