Hi everybody, I am Cuong, Welcome back to my Magento 2 tutorial video series.
Today, I am going to show everybody the best practice, How to use Ajax for the newsletter subscription in Magento 2.
By default, Magento 2 provides us with a module called Magento_Newsletter, that allows the customer to subscribe to the newsletter by submitting the form showing on the footer. However, when the customer submits the form, the current page must be reloaded, this is not good.
To improve the experience of the customer avoiding reloads the current page, we use the Ajax for submitting the form.
See the video about this tutorial here https://www.youtube.com/watch?v=6zlSJ6hYgBY&list=PL98CDCbI3TNvPczWSOnpaMoyxVISLVzYQ&index=43
![How to use Ajax for the newsletter subscription in Magento 2.png How to use Ajax for the newsletter subscription in Magento 2.png](https://community.magento.com/t5/image/serverpage/image-id/11039i9F0527D8CAA3D464/image-size/large?v=v2&px=999)
![Screenshot_1.png Screenshot_1.png](https://community.magento.com/t5/image/serverpage/image-id/11040i21EB0DBEFFC2C52C/image-size/large?v=v2&px=999)
![Screenshot_2.png Screenshot_2.png](https://community.magento.com/t5/image/serverpage/image-id/11041iB9ABBE49C7DAA7DD/image-size/large?v=v2&px=999)