diff --git a/gestion/lib/Controller/PageController.php b/gestion/lib/Controller/PageController.php index d20cb53..f52882e 100644 --- a/gestion/lib/Controller/PageController.php +++ b/gestion/lib/Controller/PageController.php @@ -1590,10 +1590,11 @@ class PageController extends Controller { $message = $this->mailer->createMessage(); $message->setTo(recipients: [$client_email => $client_nom]); // $message->setFrom([$client_email => $client_nom]); - $content = $this->mailer->createAttachment($data, "test.pdf", "application/pdf"); + $content = $this->mailer->createAttachment($data, basename($ff_pdf), "application/pdf"); $message->attach($content); $message->setSubject($subject); - $message->setPlainBody($addName ? $body." de ".$devis['defunt_nom']: $body); + $body_text = $addName ? $body." de ".$devis['defunt_nom']: $body; + $message->setPlainBody("Bonjour.\n\n".$body_text."!\n\nCordialement."); $this->mailer->send($message); return new DataResponse("", 200, ['Content-Type' => 'application/json']); // } catch (Exception $e) { @@ -2276,7 +2277,7 @@ class PageController extends Controller { if($ff_pdf != null && $isSendEmail){ //send email - $this->sendAttachmentToClientByDefunt($defunt->id, $ff_pdf, "Rapport soins", " Veuiller trouver ci-joint le rapport de soins de ".$nomDefunt."."); + $this->sendAttachmentToClientByDefunt($defunt->id, $ff_pdf, "Rapport soins", "Veuillez trouver ci-joint le rapport de soins de ".$nomDefunt."."); } $res = array(); @@ -2457,7 +2458,7 @@ class PageController extends Controller { if($ff_pdf != null && $isSendEmail){ //send email - $this->sendAttachmentToClientByDefunt($defunt->id, $ff_pdf, "Rapport des bijoux", " Veuiller trouver ci-joint le rapport des bijoux de ".$nomDefunt."."); + $this->sendAttachmentToClientByDefunt($defunt->id, $ff_pdf, "Rapport des bijoux", "Veuillez trouver ci-joint le rapport des bijoux de ".$nomDefunt."."); } $res = array(); @@ -2673,7 +2674,7 @@ class PageController extends Controller { $careCertificateFilename = $this->certificateService->generateCareCertificate($defuntId,$this->idNextcloud); if($careCertificateFilename != null && $isSendEmail){ //send email - $this->sendAttachmentToClientByDefunt($defuntId, $careCertificateFilename, "Attestation de soins", " Veuiller trouver ci-joint l'attestation de soins ", true); + $this->sendAttachmentToClientByDefunt($defuntId, $careCertificateFilename, "Attestation de soins", " Veuillez trouver ci-joint l'attestation de soins ", true); } return $careCertificateFilename; } @@ -2822,7 +2823,7 @@ class PageController extends Controller { $careCertificateFilename = $this->certificateService->generatePacemakerCertificate($defuntId,$this->idNextcloud); if($careCertificateFilename != null && $isSendEmail){ //send email - $this->sendAttachmentToClientByDefunt($defuntId, $careCertificateFilename, "Attestation pacemaker", " Veuiller trouver ci-joint l'attestation de pacemaker ", true); + $this->sendAttachmentToClientByDefunt($defuntId, $careCertificateFilename, "Attestation pacemaker", "Veuillez trouver ci-joint l'attestation de pacemaker ", true); } return $careCertificateFilename;