Blog

How to call Newsletter in static block Magento2

In this article, we are going to learn about calling the newsletter in the static block of Magento2.

  1. First, you need to decide in which static block you need to display the newsetter.
  2. In that static block, call newsletter like below. Paste below code inside that block.
{{block class="Magento\Newsletter\Block\Subscribe" name="static.newsletter" template="Magento_Newsletter::subscribe.phtml"}}

You need to put this code in the static block using html code option.

3. I have given example of displaying it on the home page block.

In the home page static block, I have selected the static block, there I have dragged the html code

4. Save and clear cache. See your newsletter on frontend as below:

 

That’s it !!

If you want to learn how to add custom field in the newsletter in Magento2, then follow this.

Leave a Reply

Your email address will not be published. Required fields are marked *