Create a custom module as below for override the newsletter success message.
app/code/Vendor/Module/registration.php
<?php
\Magento\Framework\Component\ComponentRegistrar::register(
\Magento\Framework\Component\ComponentRegistrar::MODULE,
'Vendor_Module',
__DIR__
);
app/code/Vendor/Module/etc/module.xml
<?xml version="1.0" ?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Module/etc/module.xsd">
<module name="Vendor_Module" setup_version="1.0.0">
<sequence>
<module name="Magento_Newsletter"/>
</sequence>
</module>
</config>
app/code/Vendor/Module/etc/frontend/di.xml
<?xml version="1.0" ?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd">
<preference for="Magento\Newsletter\Controller\Subscriber\NewAction" type="Vendor\Module\Rewrite\Magento\Newsletter\Controller\Subscriber\NewAction"/>
</config>
app/code/Vendor/Module/Rewrite/Magento/Newsletter/Controller/Subscriber/NewAction.php
<?php
namespace Vendor\Module\Rewrite\Magento\Newsletter\Controller\Subscriber;
class NewAction extends \Magento\Newsletter\Controller\Subscriber\NewAction
{
public function execute()
{
if ($this->getRequest()->isPost() && $this->getRequest()->getPost('email')) {
$email = (string)$this->getRequest()->getPost('email');
try {
$this->validateEmailFormat($email);
$this->validateGuestSubscription();
$this->validateEmailAvailable($email);
$subscriber = $this->_subscriberFactory->create()->loadByEmail($email);
if ($subscriber->getId()
&& $subscriber->getSubscriberStatus() == \Magento\Newsletter\Model\Subscriber::STATUS_SUBSCRIBED
) {
throw new \Magento\Framework\Exception\LocalizedException(
__('This email address is already subscribed.')
);
}
$status = $this->_subscriberFactory->create()->subscribe($email);
if ($status == \Magento\Newsletter\Model\Subscriber::STATUS_NOT_ACTIVE) {
$this->messageManager->addSuccess(__('The confirmation request has been sent.'));
} else {
$this->messageManager->addSuccess(__('Thank you for your subscription. A confirmation email will be sent to '.$email.' within 10 minutes'));
}
} catch (\Magento\Framework\Exception\LocalizedException $e) {
$this->messageManager->addException(
$e,
__('There was a problem with the subscription: %1', $e->getMessage())
);
} catch (\Exception $e) {
$this->messageManager->addException($e, __('Something went wrong with the subscription.'));
}
}
$this->getResponse()->setRedirect($this->_redirect->getRedirectUrl());
}
}
I have updated this line in the above file.
$this->messageManager->addSuccess(__('Thank you for your subscription. A confirmation email will be sent to '.$email.' within 10 minutes'));
Hope this will work for you.
Magento\Newsletter\Controller\Subscriber
.