📊 State of Magento 2025

The Home for Magento 2 Excellence

Quality-tested Magento 2 modules. Explore. Evaluate. Elevate. #magento2

606 Modules
385 Ready
218 Need Help
🏆 Leaderboard
Potentially Abandoned v1.2.1

Ajax Newsletter Subscription for Magento 2

magepal/magento2-ajax-newsletter-subscribe

This extension makes it easy to add an AJAX subscription to the Magento newsletter.

4,857
Downloads
Below average
1
GitHub Stars
Below average
5y ago
Last Release
0
Open Issues
Build Passing
Ready to install

Build Tests

Composer Install
DI Compile
Templates

Code Quality

CS Coding Standard
2 warnings
L1 PHPStan

Tested on Magento 2.4.8-p3

Recent Test History

Each release is tested against the latest Magento version at that time.

v1.2.1 on Magento 2.4.8-p3
Dec 15, 2025
v1.2.1 on Magento 2.4.8-p2
Aug 14, 2025
v1.2.1 on Magento 2.4.8
May 20, 2025
v1.2.1 on Magento 2.4.7-p4
Feb 15, 2025
v1.2.1 on Magento 2.4.7-p3
Oct 27, 2024
v1.2.1 on Magento 2.4.7-p3
Oct 18, 2024

+7 older tests

Share This Module's Status

Ajax Newsletter Subscription for Magento 2 Magento compatibility status badge

README

Loaded from GitHub

Ajax Newsletter Subscription for Magento 2

Installation

Step 1

Using Composer (recommended)
composer require magepal/magento2-ajax-newsletter-subscribe
Manually
  • Download the extension
  • Unzip the file
  • Create a folder {Magento 2 root}/app/code/MagePal/AjaxNewsletterSubscribe
  • Copy the content from *unzip folder

Step 2 - Enable extension ("cd" to {Magento root} folder)

  php -f bin/magento module:enable --clear-static-content MagePal_AjaxNewsletterSubscribe
  php -f bin/magento setup:upgrade

Usage

$('#newsletter-validate-detail').submit(function (e) {
    if ($(this).valid()) {
         var url = $form.attr('action');
         var postData = $form.serializeArray();
    
        try {
            $.ajax({
                url: url,
                dataType: 'json',
                type: 'POST',
                showLoader: true,
                data: $.param(postData),
                complete: function (data) {
                    if (typeof data === 'object') {
                        data = data.responseJSON;
                        //json object
                    } else {
                        //Unknown Error
                    }
                }
            });
        } catch (e) {
                //check for errors
        }
    }
    
    return false;
});

Return JSON


$response = [
    'status' => 1,
    'msg' => __('The confirmation request has been sent.'),
];

$response = [
    'status' => 0,
    'msg' => __('There was a problem with the subscription: %1', $e->getMessage()),
];


© MagePal LLC. | www.magepal.com

This content is fetched directly from the module's GitHub repository. We are not the authors of this content and take no responsibility for its accuracy, completeness, or any consequences arising from its use.