Call to a member function filterAccessiblePageIds() on string

I want to get page content in my function. i am developing extension for sending newslatters. my goal is add page content in mail body. i have created one new shedular task and in this task i have added one feilds pageId. Now i want to get this page content in my custome shedular task. So, i have write below code.

SendNewslatters.php

        $this->initTask();
        
        $selectedGroup = (int)$this->group;
        $pageId = (int)$this->pageId;

        
        $renderer = $this->rendererUtility->getFluidRendererForTemplate(
          'typo3conf/ext/newslatters/Resources/Private/Templates/Subscribers/Mail/NewslaterMail.html',
          'html'
        );

        $renderer->assign('pageId', $pageId);
        $message = $renderer->render();

NewslaterMail.html

<html xmlns:f="http://typo3.org/ns/TYPO3/CMS/Fluid/ViewHelpers" data-namespace-typo3-fluid="true">

     <f:cObject typoscriptObjectPath="lib.dynamicContent" data="{colPos: '0', pageUid: pageId}" />

</html>

can you please help me here? how can i resolved this error.

Leave a Comment