From bf9150a3c409086838813751ebf6349dc75ecdc3 Mon Sep 17 00:00:00 2001 From: Martin Grossmann Date: Tue, 1 Oct 2024 18:37:34 +0200 Subject: [PATCH] info about new inquiry is now sent to customer and admin - both email templates are administrable in administration --- src/Model/Mutation/Inquiry/CreateInquiryMutation.php | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/Model/Mutation/Inquiry/CreateInquiryMutation.php b/src/Model/Mutation/Inquiry/CreateInquiryMutation.php index e4cbf6e34..c010a0747 100644 --- a/src/Model/Mutation/Inquiry/CreateInquiryMutation.php +++ b/src/Model/Mutation/Inquiry/CreateInquiryMutation.php @@ -10,6 +10,7 @@ use Shopsys\FrameworkBundle\Model\Inquiry\InquiryData; use Shopsys\FrameworkBundle\Model\Inquiry\InquiryDataFactory; use Shopsys\FrameworkBundle\Model\Inquiry\InquiryFacade; +use Shopsys\FrameworkBundle\Model\Inquiry\Mail\InquiryMailFacade; use Shopsys\FrameworkBundle\Model\Product\Exception\ProductNotFoundException; use Shopsys\FrameworkBundle\Model\Product\ProductFacade; use Shopsys\FrontendApiBundle\Model\Mutation\AbstractMutation; @@ -22,6 +23,7 @@ class CreateInquiryMutation extends AbstractMutation * @param \Shopsys\FrameworkBundle\Model\Inquiry\InquiryDataFactory $inquiryDataFactory * @param \Shopsys\FrameworkBundle\Model\Inquiry\InquiryFacade $inquiryFacade * @param \Shopsys\FrameworkBundle\Model\Product\ProductFacade $productFacade + * @param \Shopsys\FrameworkBundle\Model\Inquiry\Mail\InquiryMailFacade $inquiryMailFacade * @param \Shopsys\FrameworkBundle\Component\Domain\Domain $domain */ public function __construct( @@ -29,6 +31,7 @@ public function __construct( protected readonly InquiryDataFactory $inquiryDataFactory, protected readonly InquiryFacade $inquiryFacade, protected readonly ProductFacade $productFacade, + protected readonly InquiryMailFacade $inquiryMailFacade, protected readonly Domain $domain, ) { } @@ -41,7 +44,9 @@ public function createInquiryMutation(Argument $argument): bool { try { $inquiryData = $this->createInquiryDataFromArgument($argument); - $this->inquiryFacade->create($inquiryData); + $inquiry = $this->inquiryFacade->create($inquiryData); + + $this->inquiryMailFacade->sendMail($inquiry); return true; } catch (ProductNotFoundException) {