How to call newsletter subscribe in Magento 2?

If you want to call the newsletter subscribe in CMS page/block. Please use the below code:

{{block class="Magento\Newsletter\Block\Subscribe" name="static.newsletter" template="Magento_Newsletter::subscribe.phtml"}}
If you want to call the newsletter subscribe in phtml file. Please use the below code:

<?php echo $this->getLayout()->createBlock('newsletter/subscribe')->setTemplate('newsletter/subscribe.phtml')->toHtml(); ?>
If you want to call the newsletter subscribe using XML file. Please use the below code:

<referenceContainer name="nsubscribe">
            <block class="Magento\Newsletter\Block\Subscribe" name="form.subscribe" as="subscribe" before="-" template="subscribe.phtml"/>
</referenceContainer>

Please leave your comment for asking any question or suggestion.

Need Help? How to call newsletter subscribe in Magento 2?

expoundsofttechsolution How to call newsletter subscribe in Magento 2?