In magento2 I want to get the newsletter template or static block in my template.phtml
.
I tried to use
<?php echo $this->getLayout()->createBlock("Magento\Newsletter\Block\Subscribe")->getTemplate('subscribe.phtml')->toHtml(); ?>
but without success. Can anyone help?
->createBlock(Magento\Newsletter\Block\Subscribe::class)
instead.