Exceptions
Exception
Twig\Error\ RuntimeError
<tr>
<td align="center" valign="top"
class="r13-i nl2go-default-textstyle"
style="color: #3b3f44; font-family: arial,helvetica,sans-serif; font-size: 16px; background-color: #ffffff; line-height: custom; padding-top: 5px; text-align: center;">
<div>
<p style="margin: 0;">Bonjour {{ contact.firstname }},<br><br>
Vous avez reçu une e-carte cadeau Papa Pique et Maman Coud de la part de {{ order.customer.lastName }} {{ order.customer.firstName }}. Vous pouvez la consulter en pièce jointe de ce mail.</p>
<p style="margin: 0;"> </p>
<p style="margin: 0;">Cette carte cadeau est un moyen de paiement <strong>valable un an sur <a href="https://www.papapiqueetmamancoud.fr/" target="_blank"><u>notre site internet</u></a></strong> ainsi que <strong><a href="https://www.papapiqueetmamancoud.fr/boutique-ppmc" target="_blank"><u>dans nos boutiques</u></a></strong></p>
in
vendor/twig/twig/src/Environment.php(418) : eval()'d code
->
{closure}
(line 137)
in
vendor/twig/twig/src/Template.php
->
block_content
(line 182)
throw new \LogicException('A block must be a method on a \Twig\Template instance.');
}
if (null !== $template) {
try {
$template->$block($context, $blocks);
} catch (Error $e) {
if (!$e->getSourceContext()) {
$e->setSourceContext($template->getSourceContext());
}
in
vendor/twig/twig/src/Environment.php(418) : eval()'d code
->
displayBlock
(line 78)
in
vendor/twig/twig/src/Template.php
->
block_body
(line 182)
throw new \LogicException('A block must be a method on a \Twig\Template instance.');
}
if (null !== $template) {
try {
$template->$block($context, $blocks);
} catch (Error $e) {
if (!$e->getSourceContext()) {
$e->setSourceContext($template->getSourceContext());
}
in
vendor/twig/twig/src/Template.php
->
displayBlock
(line 202)
$e->guess();
throw $e;
}
} elseif (false !== $parent = $this->getParent($context)) {
$parent->displayBlock($name, $context, array_merge($this->blocks, $blocks), false, $templateContext ?? $this);
} elseif (isset($blocks[$name])) {
throw new RuntimeError(sprintf('Block "%s" should not call parent() in "%s" as the block does not exist in the parent template "%s".', $name, $blocks[$name][0]->getTemplateName(), $this->getTemplateName()), -1, $blocks[$name][0]->getSourceContext());
} else {
throw new RuntimeError(sprintf('Block "%s" on template "%s" does not exist.', $name, $this->getTemplateName()), -1, ($templateContext ?? $this)->getSourceContext());
}
in
vendor/twig/twig/src/Template.php
->
displayBlock
(line 254)
if ($this->env->isDebug()) {
ob_start();
} else {
ob_start(function () { return ''; });
}
$this->displayBlock($name, $context, $blocks, $useBlocks);
return ob_get_clean();
}
/**
in
vendor/sylius/mailer-bundle/src/Bundle/Renderer/Adapter/EmailTwigAdapter.php
->
renderBlock
(line 75)
$data = $this->twig->mergeGlobals($data);
$template = $this->twig->load((string) $email->getTemplate())->unwrap();
$subject = $template->renderBlock('subject', $data);
$body = $template->renderBlock('body', $data);
return new RenderedEmail($subject, $body);
}
private function provideEmailWithoutTemplate(EmailInterface $email, array $data): RenderedEmail
in
vendor/sylius/mailer-bundle/src/Bundle/Renderer/Adapter/EmailTwigAdapter.php
->
provideEmailWithTemplate
(line 59)
}
private function getRenderedEmail(EmailInterface $email, array $data): RenderedEmail
{
if (null !== $email->getTemplate()) {
return $this->provideEmailWithTemplate($email, $data);
}
return $this->provideEmailWithoutTemplate($email, $data);
}
in
vendor/sylius/mailer-bundle/src/Bundle/Renderer/Adapter/EmailTwigAdapter.php
->
getRenderedEmail
(line 44)
/**
* {@inheritdoc}
*/
public function render(EmailInterface $email, array $data = []): RenderedEmail
{
$renderedEmail = $this->getRenderedEmail($email, $data);
$event = new EmailRenderEvent($renderedEmail);
if ($this->dispatcher !== null) {
/** @var EmailRenderEvent $event */
in
vendor/bitbag/mailtemplate-plugin/src/EmailSender/Sender.php
->
render
(line 79)
}
$senderAddress = $email->getSenderAddress() ?? $this->defaultSettingsProvider->getSenderAddress();
$senderName = $email->getSenderName() ?? $this->defaultSettingsProvider->getSenderName();
$renderedEmail = $this->rendererAdapter->render($email, $data);
$this->senderAdapter->send(
$recipients, /** @phpstan-ignore-line */
$senderAddress,
$senderName,
// ['Content-Type' => 'application/pdf']
// );
$filepath = $this->getParameter('kernel.project_dir') . '/public/media/pdf/cartecadeau.pdf';
// $sender->send('cartecadeau', ['mollivier@webapic.com'], array(), array($filepath));
return new Response (
$dompdf->stream('resume', ["Attachment" => false]),
Response::HTTP_OK,
['Content-Type' => 'application/pdf']
in
vendor/symfony/http-kernel/HttpKernel.php
->
carteCadeau
(line 163)
$this->dispatcher->dispatch($event, KernelEvents::CONTROLLER_ARGUMENTS);
$controller = $event->getController();
$arguments = $event->getArguments();
// call controller
$response = $controller(...$arguments);
// view
if (!$response instanceof Response) {
$event = new ViewEvent($this, $request, $type, $response);
$this->dispatcher->dispatch($event, KernelEvents::VIEW);
in
vendor/symfony/http-kernel/HttpKernel.php
->
handleRaw
(line 75)
{
$request->headers->set('X-Php-Ob-Level', (string) ob_get_level());
$this->requestStack->push($request);
try {
return $this->handleRaw($request, $type);
} catch (\Exception $e) {
if ($e instanceof RequestExceptionInterface) {
$e = new BadRequestHttpException($e->getMessage(), $e);
}
if (false === $catch) {
in
vendor/symfony/http-kernel/Kernel.php
->
handle
(line 202)
$this->boot();
++$this->requestStackSize;
$this->resetServices = true;
try {
return $this->getHttpKernel()->handle($request, $type, $catch);
} finally {
--$this->requestStackSize;
}
}
$_SERVER['HTTPS'] = 'on';
$kernel = new Kernel($_SERVER['APP_ENV'], (bool) $_SERVER['APP_DEBUG']);
$request = Request::createFromGlobals();
$response = $kernel->handle($request);
$response->send();
$kernel->terminate($request, $response);
Logs
No log messages
Stack Trace
RuntimeError
|
---|
Twig\Error\RuntimeError: Variable "contact" does not exist. at themes/webapicTheme/templates/mails/cartecadeau.html.twig:44 at __TwigTemplate_aaed6fc5723aa4f0dc341584cd2989ebc6128395570eb3cdf1bf9e5bd56a862c->{closure}() (vendor/twig/twig/src/Environment.php(418) : eval()'d code:137) at __TwigTemplate_aaed6fc5723aa4f0dc341584cd2989ebc6128395570eb3cdf1bf9e5bd56a862c->block_content() (vendor/twig/twig/src/Template.php:182) at Twig\Template->displayBlock() (vendor/twig/twig/src/Environment.php(418) : eval()'d code:78) at __TwigTemplate_516a517cd091585143c7f7c54c6cfd1bba9f69ab94fd8346e42cadd8e19731c0->block_body() (vendor/twig/twig/src/Template.php:182) at Twig\Template->displayBlock() (vendor/twig/twig/src/Template.php:202) at Twig\Template->displayBlock() (vendor/twig/twig/src/Template.php:254) at Twig\Template->renderBlock() (vendor/sylius/mailer-bundle/src/Bundle/Renderer/Adapter/EmailTwigAdapter.php:75) at Sylius\Bundle\MailerBundle\Renderer\Adapter\EmailTwigAdapter->provideEmailWithTemplate() (vendor/sylius/mailer-bundle/src/Bundle/Renderer/Adapter/EmailTwigAdapter.php:59) at Sylius\Bundle\MailerBundle\Renderer\Adapter\EmailTwigAdapter->getRenderedEmail() (vendor/sylius/mailer-bundle/src/Bundle/Renderer/Adapter/EmailTwigAdapter.php:44) at Sylius\Bundle\MailerBundle\Renderer\Adapter\EmailTwigAdapter->render() (vendor/bitbag/mailtemplate-plugin/src/EmailSender/Sender.php:79) at BitBag\SyliusMailTemplatePlugin\EmailSender\Sender->send() (src/Controller/PdfGeneratorController.php:53) at App\Controller\PdfGeneratorController->carteCadeau() (vendor/symfony/http-kernel/HttpKernel.php:163) at Symfony\Component\HttpKernel\HttpKernel->handleRaw() (vendor/symfony/http-kernel/HttpKernel.php:75) at Symfony\Component\HttpKernel\HttpKernel->handle() (vendor/symfony/http-kernel/Kernel.php:202) at Symfony\Component\HttpKernel\Kernel->handle() (public/index.php:31) |