Skip to content

Commit f0c73b2

Browse files
committed
MC-29102: [2.4.x] [Magento Cloud] Customer receives newsletter unsubscription email after registering for new account
1 parent d030b9a commit f0c73b2

File tree

4 files changed

+10
-7
lines changed

4 files changed

+10
-7
lines changed

app/code/Magento/Newsletter/Controller/Ajax/Status.php

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,8 @@
55
*/
66
namespace Magento\Newsletter\Controller\Ajax;
77

8-
use Magento\Framework\App\Action\Context;
8+
use Magento\Framework\App\Action;
9+
use Magento\Framework\App\Action\HttpGetActionInterface;
910
use Magento\Framework\Controller\ResultFactory;
1011
use Magento\Framework\Exception\LocalizedException;
1112
use Magento\Framework\Validator\EmailAddress as EmailAddressValidator;
@@ -15,7 +16,7 @@
1516
/**
1617
* Newsletter subscription status verification controller.
1718
*/
18-
class Status extends \Magento\Framework\App\Action\Action
19+
class Status extends Action\Action implements HttpGetActionInterface
1920
{
2021
/**
2122
* @var EmailAddressValidator
@@ -33,13 +34,13 @@ class Status extends \Magento\Framework\App\Action\Action
3334
private $logger;
3435

3536
/**
36-
* @param Context $context
37+
* @param Action\Context $context
3738
* @param EmailAddressValidator $emailAddressValidator
3839
* @param GuestSubscriptionChecker $guestSubscriptionChecker
3940
* @param LoggerInterface $logger
4041
*/
4142
public function __construct(
42-
Context $context,
43+
Action\Context $context,
4344
EmailAddressValidator $emailAddressValidator,
4445
GuestSubscriptionChecker $guestSubscriptionChecker,
4546
LoggerInterface $logger

app/code/Magento/Newsletter/Model/GuestSubscriptionChecker.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,8 @@ public function __construct(ResourceConnection $resourceConnection, StoreManager
3535
}
3636

3737
/**
38+
* Check is subscribed by email
39+
*
3840
* @param string $subscriberEmail
3941
* @return bool
4042
*/

app/code/Magento/Newsletter/view/frontend/web/js/newsletter-sign-up.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ define([
3232
/**
3333
* Send status request and update subscription element according to result.
3434
*/
35-
updateSignUpStatus: function() {
35+
updateSignUpStatus: function () {
3636
let element = $(this.element),
3737
email = element.val(),
3838
self = this,

app/code/Magento/Newsletter/view/frontend/web/js/subscription-status-resolver.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ define([
1010
], function ($, storage, urlBuilder) {
1111
'use strict';
1212

13-
return function(email, deferred) {
13+
return function (email, deferred) {
1414
return $.getJSON(
1515
urlBuilder.build('newsletter/ajax/status'),
1616
{
@@ -21,5 +21,5 @@ define([
2121
}).fail(function () {
2222
deferred.reject();
2323
});
24-
}
24+
};
2525
});

0 commit comments

Comments
 (0)