Action on post render event of mail templater.

@param FilterPostRenderEvent $event The event
769016
public function onPostRender(FilterPostRenderEvent $event): void
    {
        foreach ($this->registry->getTemplateFilters() as $filter) {
            if (null !== ($mailRendered = $event->getMailRendered())
                    && $filter->supports($mailRendered)) {
                $filter->filter($mailRendered);
            }
        }
    }
910883
public function onKernelResponse(FilterResponseEvent $event): void
    {
        $apiDocUrl = $this->urlGenerator->generate('api_doc', ['_format' => 'jsonld'], UrlGeneratorInterface::ABS_URL);
        $link = new Link(ContextBuilder::HYDRA_NS.'apiDocumentation', $apiDocUrl);

        $attributes = $event->getRequest()->attributes;
        if (null === $linkProvider = $attributes->get('_links')) {
            $attributes->set('_links', new GenericLinkProvider([$link]));

            return;
        }
        $attributes->set('_links', $linkProvider->withLink($link));
    }
1224467
public function onKernelResponse(FilterResponseEvent $event)
    {
        $response = $event->getResponse();
        $request  = $event->getRequest();
        if (!$event->isMasterRequest())
        {
            return;
        }
        if ($request->isXmlHttpRequest())
        {
            return;
        }
        $this->_injectDatatableScript($response, $request);
    }
1016080
public function onKernelResponse(FilterResponseEvent $event)
    {
        if ($this->getParameter('nyroDev_utility.setContentLanguageResponse') && $event->getResponse() && $event->getResponse()->headers && $event->getRequest()->getLocale()) {
            $event->getResponse()->headers->set('Content-Language', $event->getRequest()->getLocale());
        }
    }
240669
public function onPostActivate(PostActivateEvent $event): void
    {
        $user = $event->getUser();

        $this->ezUserAccountKeyRepository->removeByUserId($user->id);
        $this->ngUserSettingRepository->activateUser($user->id);

        $this->mailHelper
            ->sendMail(
                [$user->email => $this->getUserName($user)],
                'ngsite.user.welcome.subject',
                $this->configResolver->getParameter('template.user.mail.welcome', 'ngsite'),
                [
                    'user' => $user,
                ]
            );
    }
442047
public function onKernelResponse(FilterResponseEvent $event)
    {
        $request = $event->getRequest();
        $routeName = $request->attributes->get('_route');
        if (!$route = $this->app['routes']->get($routeName)) {
            return;
        }

        foreach ((array) $route->getOption('_after_middlewares') as $callback) {
            $response = call_user_func($this->app['callback_resolver']->resolveCallback($callback), $request, $event->getResponse(), $this->app);
            if ($response instanceof Response) {
                $event->setResponse($response);
            } elseif (null !== $response) {
                throw new \RuntimeException(sprintf('An after middleware for route "%s" returned an invalid response value. Must return null or an instance of Response.', $routeName));
            }
        }
    }
995706
public function onKernelResponse(FilterResponseEvent $event)
    {
        $response = $event->getResponse();
        $request = $event->getRequest();

        $ifNoneMatch = $request->headers->get('if-none-match');
        $etag = $response->headers->get('ETag', 'empty');

        if ($ifNoneMatch === $etag) {
            $response->setStatusCode(304);
            $response->setContent(null);
        }
    }
617548
public function onPostSerialize(ObjectEvent $event)
    {
        $customUrl = $event->getObject();
        $visitor = $event->getVisitor();

        if (!$customUrl instanceof CustomUrlDocument) {
            return;
        }

        if (null !== $customUrl->getTargetDocument()) {
            $visitor->addData('targetTitle', $customUrl->getTargetDocument()->getTitle());
            $visitor->addData('targetDocument', $customUrl->getTargetDocument()->getUuid());
        }

        $visitor->addData(
            'customUrl',
            $this->generator->generate($customUrl->getBaseDomain(), $customUrl->getDomainParts())
        );

        $visitor->addData('creatorFullName', $this->userManager->getFullNameByUserId($customUrl->getCreator()));
        $visitor->addData('changerFullName', $this->userManager->getFullNameByUserId($customUrl->getChanger()));
    }
888972
public function postSubmit(FormEvent $event)
    {
        $data = $event->getData();

        if ($this->itemDataClass !== null) {
            $itemMetadata = $this->getClassMetadata($this->itemDataClass);
            if ($itemMetadata !== null) {
                $this->cleanupCollection($data, $itemMetadata);
            }
        }
    }
857203
public function onResponseEarly(FilterResponseEvent $event)
    {
        if (!$this->eventRequestMatches($event)) {
            return;
        }
        $event->setResponse($this->responseTransformer->transformEarly($event->getRequest(), $event->getResponse()));
    }
1229763
public function onKernelResponse(FilterResponseEvent $event)
    {
        if ($event->getRequestType() != HttpKernelInterface::MASTER_REQUEST) {
            return;
        }

        if ($event->getRequest()->isXmlHttpRequest()) {
            return;
        }

        if ($this->joomla->getState() === JoomlaInterface::STATE_RESPONSE) {
            return;
        }

        $menu = $this->pathMatcher->findMenuPointForRequest($event->getRequest());

        if ($menu === null) {
            $match = false;

            foreach ($this->pattern as $pattern) {
                if (preg_match('#' . $pattern . '#i', $event->getRequest()->getPathInfo())) {
                    $match = true;
                    break;
                }
            }

            if (!$match) {
                return;
            }
        }

        $response = $event->getResponse();
        $contentType = $response->headers->get('Content-Type');

        if ($contentType === null || $contentType === 'text/html') {
            $helper = new JoomlaControllerHelper(
                $this->joomla,
                $event->getRequest(),
                $this->factory
            );

            $newResponse = $helper->wrapResponse($response, $menu);
            $response->setContent($newResponse->getContent());
        }
    }
877239
public function onPostSerialize(ObjectEvent $event)
    {
        $visitor = $event->getVisitor();
        $document = $event->getObject();

        if (!$document instanceof PathBehavior || !$this->documentRegistry->hasDocument($document)) {
            return;
        }

        $visitor->addData('path', $this->documentInspector->getContentPath($document));
    }
870462
public function onKernelResponse(FilterResponseEvent $event)
    {
        $response = $event->getResponse();
        if (!$event->isMasterRequest() || !$response->isRedirect()) {
            return;
        }

        if (!$this->isPlatformUIRequest($event->getRequest())) {
            return;
        }

        $response->setStatusCode(Response::HTTP_RESET_CONTENT);
        $response->headers->set('PJAX-Location', $response->headers->get('Location'));
        $response->headers->remove('Location');
    }
1297325
public function onKernelResponse(FilterResponseEvent $event)
    {
        $request = $event->getRequest();
        $id = $request->get($this->ajaxId);

        if (!$request->isXmlHttpRequest() || null === $id) {
            return;
        }

        if (!isset($this->ajaxEvents[$id])) {
            $event->setResponse(new Response());

            return;
        }

        $ajaxEvent = $this->ajaxEvents[$id];

        $request->setRequestFormat($ajaxEvent->getFormat());
        $event->setResponse($ajaxEvent->generateResponse());
        $event->stopPropagation();
    }
528389
public function onPostRenderPage(RendererEvent $event)
    {
        // Checks if page caching is available
        $this->object = $event->getTarget();
        if (false === ($this->object instanceof Page) || false === $this->checkCachePageEvent()) {
            return;
        }

        // Checks if cache_id is available
        if (false === $cache_id = $this->getPageCacheId()) {
            return;
        }

        $column_uids = array();
        foreach ($this->object->getContentSet() as $column) {
            if ($column instanceof AbstractClassContent) {
                $column_uids[] = $column->getUid();
            }
        }

        $lifetime = $this->cache_page->getMinExpireByTag($column_uids);
        $render = $event->getRender();
        $this->cache_page->save($cache_id, $render, $lifetime, $this->object->getUid());
        $this->application->debug(sprintf(
            'Save cache (id: %s, lifetime: %d) for rendering `%s(%s)` with mode `%s`.',
            $cache_id,
            $lifetime,
            get_class($this->object),
            $this->object->getUid(),
            $event->getRenderer()->getMode()
        ));
    }
1329522
public function onKernelResponse(FilterResponseEvent $event)
    {
        if (HttpKernelInterface::MASTER_REQUEST !== $event->getRequestType()) {
            return;
        }

        $response = $event->getResponse();
        $request = $event->getRequest();

        // do not capture redirects or modify XML HTTP Requests
        if ($request->isXmlHttpRequest()) {
            return;
        }

        // do not capture admin cms urls
        if (preg_match('/.*\/admin\/.*/', $request->getRequestUri())) {
            return;
        }

        // do not capture profiler urls
        if (preg_match('/.*\/_profiler\/.*/', $request->getRequestUri())) {
            return;
        }

        try {
            if (!$this->authorizationChecker->isGranted('ROLE_ADMIN')) {
                return;
            }
        } catch (AuthenticationCredentialsNotFoundException $e) {
            return;
        }

        if (self::DISABLED === $this->mode
            || $response->isRedirection()
            || ($response->headers->has('Content-Type') && false === strpos($response->headers->get('Content-Type'), 'html'))
            || 'html' !== $request->getRequestFormat()
        ) {
            return;
        }

        $this->injectToolbar($response, $request);
    }
862703
public function onResponse(FilterResponseEvent $event)
    {
        // $response = $event->getResponse();
        // $headers  = $response->headers;

        // $headers->set('Content-Length', 11);

        // if (!$headers->has('Content-Length') && !$headers->has('Transfer-Encoding')) {
        //     $headers->set('Content-Length', strlen($response->getContent()));
        // }



        $request = $event->getRequest();
        $response = $event->getResponse();

        if ('HEAD' === $request->getMethod()) {
            // cf. RFC2616 14.13
            $length = $response->headers->get('Content-Length');
            $response->setContent('');
            if ($length) {
                $response->headers->set('Content-Length', $length);
            }
        }

        if ($response->getCharset() === null) {
            $response->setCharset($this->charset);
        }

        $annotations = $event->getAnnotations();

        // override headers from annotations
        if ($annotations instanceof ResponseAnnotation) {
            $annotatedHeaders = $annotations->getHeaders();

            foreach ($annotatedHeaders as $key => $value) {
                $response->headers->set($key, $value);
            }
        }
        // end annotated headers

        if ($response->headers->has('Content-Type')) {
            return;
        }

        $format = $request->getRequestFormat();

        if (($format !== null) && ($mimeType = $request->getMimeType($format))) {
            $response->headers->set('Content-Type', $mimeType);
        }
    }