Skip to content

Commit

Permalink
info about new inquiry is now sent to customer and admin
Browse files Browse the repository at this point in the history
- both email templates are administrable in administration
  • Loading branch information
grossmannmartin committed Nov 6, 2024
1 parent 785d5cc commit bf9150a
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/Model/Mutation/Inquiry/CreateInquiryMutation.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -22,13 +23,15 @@ 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(
protected readonly LoggerInterface $logger,
protected readonly InquiryDataFactory $inquiryDataFactory,
protected readonly InquiryFacade $inquiryFacade,
protected readonly ProductFacade $productFacade,
protected readonly InquiryMailFacade $inquiryMailFacade,
protected readonly Domain $domain,
) {
}
Expand All @@ -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) {
Expand Down

0 comments on commit bf9150a

Please sign in to comment.