return new JsonResponse(null, Response::HTTP_NO_CONTENT
);
} #[Route(path: '/api/_action/mail-template/build', name: 'api.action.mail_template.build', methods: ['POST'])]
public function build(RequestDataBag
$post, Context
$context): JsonResponse
{ $contents =
[];
$data =
$post->
all();
$templateData =
$data['mailTemplateType'
]['templateData'
];
$this->templateRenderer->
enableTestMode();
$contents['text/html'
] =
$this->templateRenderer->
render($data['mailTemplate'
]['contentHtml'
],
$templateData,
$context);
$this->templateRenderer->
disableTestMode();
return new JsonResponse($contents['text/html'
]);
}}