The Home for
Magento Excellence

Explore. Discover. Elevate. #magento

162
Modules Tested
98
Ready for Magento 2.4
64
Need Your Help
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,813
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
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

GitHub Repository
Source code & docs
Packagist
Version history
Issues & Support
Get help or report bugs

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.

Back to All Modules