https://ppmc-staging.webapic.com/pdf/cartecadeau

Exceptions

Variable "contact" does not exist.

Exception

Twig\Error\ RuntimeError

  1.                     <tr>
  2.                         <td align="center" valign="top"
  3.                             class="r13-i nl2go-default-textstyle"
  4.                             style="color: #3b3f44; font-family: arial,helvetica,sans-serif; font-size: 16px; background-color: #ffffff; line-height: custom; padding-top: 5px; text-align: center;">
  5.                             <div>
  6.                                 <p style="margin: 0;">Bonjour&nbsp;{{ contact.firstname }},<br><br>
  7.                                                                 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>
  8.                                                                 <p style="margin: 0;">&nbsp;</p>
  9.                                                                 <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/Template.php -> block_content (line 182)
  1.             throw new \LogicException('A block must be a method on a \Twig\Template instance.');
  2.         }
  3.         if (null !== $template) {
  4.             try {
  5.                 $template->$block($context$blocks);
  6.             } catch (Error $e) {
  7.                 if (!$e->getSourceContext()) {
  8.                     $e->setSourceContext($template->getSourceContext());
  9.                 }
in vendor/twig/twig/src/Template.php -> block_body (line 182)
  1.             throw new \LogicException('A block must be a method on a \Twig\Template instance.');
  2.         }
  3.         if (null !== $template) {
  4.             try {
  5.                 $template->$block($context$blocks);
  6.             } catch (Error $e) {
  7.                 if (!$e->getSourceContext()) {
  8.                     $e->setSourceContext($template->getSourceContext());
  9.                 }
in vendor/twig/twig/src/Template.php -> displayBlock (line 202)
  1.                 $e->guess();
  2.                 throw $e;
  3.             }
  4.         } elseif (false !== $parent $this->getParent($context)) {
  5.             $parent->displayBlock($name$contextarray_merge($this->blocks$blocks), false$templateContext ?? $this);
  6.         } elseif (isset($blocks[$name])) {
  7.             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());
  8.         } else {
  9.             throw new RuntimeError(sprintf('Block "%s" on template "%s" does not exist.'$name$this->getTemplateName()), -1, ($templateContext ?? $this)->getSourceContext());
  10.         }
in vendor/twig/twig/src/Template.php -> displayBlock (line 254)
  1.         if ($this->env->isDebug()) {
  2.             ob_start();
  3.         } else {
  4.             ob_start(function () { return ''; });
  5.         }
  6.         $this->displayBlock($name$context$blocks$useBlocks);
  7.         return ob_get_clean();
  8.     }
  9.     /**
  1.         $data $this->twig->mergeGlobals($data);
  2.         $template $this->twig->load((string) $email->getTemplate())->unwrap();
  3.         $subject $template->renderBlock('subject'$data);
  4.         $body $template->renderBlock('body'$data);
  5.         return new RenderedEmail($subject$body);
  6.     }
  7.     private function provideEmailWithoutTemplate(EmailInterface $email, array $data): RenderedEmail
  1.     }
  2.     private function getRenderedEmail(EmailInterface $email, array $data): RenderedEmail
  3.     {
  4.         if (null !== $email->getTemplate()) {
  5.             return $this->provideEmailWithTemplate($email$data);
  6.         }
  7.         return $this->provideEmailWithoutTemplate($email$data);
  8.     }
  1.     /**
  2.      * {@inheritdoc}
  3.      */
  4.     public function render(EmailInterface $email, array $data = []): RenderedEmail
  5.     {
  6.         $renderedEmail $this->getRenderedEmail($email$data);
  7.         $event = new EmailRenderEvent($renderedEmail);
  8.         if ($this->dispatcher !== null) {
  9.             /** @var EmailRenderEvent $event */
  1.         }
  2.         $senderAddress $email->getSenderAddress() ?? $this->defaultSettingsProvider->getSenderAddress();
  3.         $senderName $email->getSenderName() ?? $this->defaultSettingsProvider->getSenderName();
  4.         $renderedEmail $this->rendererAdapter->render($email$data);
  5.         $this->senderAdapter->send(
  6.             $recipients/** @phpstan-ignore-line */
  7.             $senderAddress,
  8.             $senderName,
  1.         //     ['Content-Type' => 'application/pdf']
  2.         // );
  3.         $filepath $this->getParameter('kernel.project_dir') . '/public/media/pdf/cartecadeau.pdf';
  4.         // $sender->send('cartecadeau', ['mollivier@webapic.com'], array(), array($filepath));
  5.         return  new Response (
  6.             $dompdf->stream('resume', ["Attachment" => false]),
  7.             Response::HTTP_OK,
  8.             ['Content-Type' => 'application/pdf']
in vendor/symfony/http-kernel/HttpKernel.php -> carteCadeau (line 163)
  1.         $this->dispatcher->dispatch($eventKernelEvents::CONTROLLER_ARGUMENTS);
  2.         $controller $event->getController();
  3.         $arguments $event->getArguments();
  4.         // call controller
  5.         $response $controller(...$arguments);
  6.         // view
  7.         if (!$response instanceof Response) {
  8.             $event = new ViewEvent($this$request$type$response);
  9.             $this->dispatcher->dispatch($eventKernelEvents::VIEW);
  1.     {
  2.         $request->headers->set('X-Php-Ob-Level', (string) ob_get_level());
  3.         $this->requestStack->push($request);
  4.         try {
  5.             return $this->handleRaw($request$type);
  6.         } catch (\Exception $e) {
  7.             if ($e instanceof RequestExceptionInterface) {
  8.                 $e = new BadRequestHttpException($e->getMessage(), $e);
  9.             }
  10.             if (false === $catch) {
  1.         $this->boot();
  2.         ++$this->requestStackSize;
  3.         $this->resetServices true;
  4.         try {
  5.             return $this->getHttpKernel()->handle($request$type$catch);
  6.         } finally {
  7.             --$this->requestStackSize;
  8.         }
  9.     }
Kernel->handle() in public/index.php (line 31)
  1. $_SERVER['HTTPS'] = 'on';
  2. $kernel = new Kernel($_SERVER['APP_ENV'], (bool) $_SERVER['APP_DEBUG']);
  3. $request Request::createFromGlobals();
  4. $response $kernel->handle($request);
  5. $response->send();
  6. $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)