Skip to content

Commit 69eb20f

Browse files
committed
Change Success messages to appropriated
1 parent 3227832 commit 69eb20f

File tree

2 files changed

+7
-7
lines changed
  • app/code/Magento/Newsletter/Controller/Manage
  • dev/tests/integration/testsuite/Magento/Newsletter/Controller

2 files changed

+7
-7
lines changed

app/code/Magento/Newsletter/Controller/Manage/Save.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -80,24 +80,24 @@ public function execute()
8080
->getIsSubscribed();
8181
$isSubscribedParam = (boolean)$this->getRequest()
8282
->getParam('is_subscribed', false);
83-
if ($isSubscribedParam != $isSubscribedState) {
83+
if ($isSubscribedParam !== $isSubscribedState) {
8484
$this->customerRepository->save($customer);
8585
if ($isSubscribedParam) {
8686
$subscribeModel = $this->subscriberFactory->create()
8787
->subscribeCustomerById($customerId);
8888
$subscribeStatus = $subscribeModel->getStatus();
8989
if ($subscribeStatus == Subscriber::STATUS_SUBSCRIBED) {
90-
$this->messageManager->addSuccess(__('We saved the subscription.'));
90+
$this->messageManager->addSuccess(__('We have saved your subscription.'));
9191
} else {
92-
$this->messageManager->addSuccess(__('The confirmation request has been sent.'));
92+
$this->messageManager->addSuccess(__('A confirmation request has been sent.'));
9393
}
9494
} else {
9595
$this->subscriberFactory->create()
9696
->unsubscribeCustomerById($customerId);
97-
$this->messageManager->addSuccess(__('We removed the subscription.'));
97+
$this->messageManager->addSuccess(__('We have removed your newsletter subscription.'));
9898
}
9999
} else {
100-
$this->messageManager->addSuccess(__('We updated the subscription.'));
100+
$this->messageManager->addSuccess(__('We have updated your subscription.'));
101101
}
102102
} catch (\Exception $e) {
103103
$this->messageManager->addError(__('Something went wrong while saving your subscription.'));

dev/tests/integration/testsuite/Magento/Newsletter/Controller/ManageTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ public function testSaveAction()
5858
* Check that success message
5959
*/
6060
$this->assertSessionMessages(
61-
$this->equalTo(['We saved the subscription.']),
61+
$this->equalTo(['We have saved your subscription.']),
6262
\Magento\Framework\Message\MessageInterface::TYPE_SUCCESS
6363
);
6464
}
@@ -85,7 +85,7 @@ public function testSaveActionRemoveSubscription()
8585
* Check that success message
8686
*/
8787
$this->assertSessionMessages(
88-
$this->equalTo(['We updated the subscription.']),
88+
$this->equalTo(['We have updated your subscription.']),
8989
\Magento\Framework\Message\MessageInterface::TYPE_SUCCESS
9090
);
9191
}

0 commit comments

Comments
 (0)