Hello Magento Friends,

In today’s blog file, we will learn about How to Add Custom Field in Newsletter Subscription in Magento 2.

A newsletter subscription helps to grow the customer base through email marketing. Grab customer attention and increase email subscribers using Magento 2 Newsletter Popup.

In default Magento, the newsletter subscription option contains only one field, i.e., email ID.

default magento newsletter

Sometimes you may need additional information from your newsletter subscribers like name, gender, city, occupation, or age.

Collecting extra details helps store owners in the following ways:

  • Effective email marketing
  • Better customer targeting
  • Improve customer engagement
  • Provide a personalized customer experience

In Magento 2, we can add custom fields in the newsletter using the below steps.

Steps to Add Custom Field in Newsletter Subscription in Magento 2:

Step 1: Create registration.php file in the given below path


Now, add the following code

Step 2: Now, create module.xml file at the following path


Then embed the below code

Step 3: Next, create db_schema.xml at the below-mentioned path to add a custom field in the database.


Now, add the below code-snippet

Step 4: Create default.xml file at the path mentioned underneath to display form in all pages


Now include the code as mentioned-below

Step 5: Next, create customsubscribe.phtml at the below path


And add the following piece of code

Step 6: Create di.xml at the below path


Next, incorporate the following code-snippet

Step 7: Now create plugin file SubscriptionManager.php at the following path 


Then add the below-mentioned code

Step 8: Finally, create newsletter_subscriber_block.xml at the below path to display a custom field in the admin grid.


And add the code as follows

Step 9: At last, run the below commands


When you successfully complete the above steps, an additional custom field is added to the newsletter subscription along with the email ID field.

Admin also gets the details of the custom fields in the backend newsletter subscribers grid.


Hence, this way, you can add custom fields to newsletter subscription in Magento 2. If you face any difficulty in the above steps, let me know through the comment section. I will be quick to resolve your errors and queries.

Share the solution with your friends and stay in touch with us for more Magento 2 tutorials.

Happy Coding!

Click to rate this post!
[Total: 4 Average: 5]