Prevent showing mailer errors to subscribers
[MAILPOET-2120]
This commit is contained in:
@@ -117,12 +117,12 @@ class ConfirmationEmailMailer {
|
||||
$this->mailer->getReplyToNameAndAddress($reply_to);
|
||||
$result = $this->mailer->send($email, $subscriber);
|
||||
if ($result['response'] === false) {
|
||||
$subscriber->setError($result['error'] instanceof MailerError ? $result['error']->getMessage() : 'Unknown Error.');
|
||||
$subscriber->setError(__('Something went wrong with your subscription. Please contact the website owner.', 'mailpoet'));
|
||||
return false;
|
||||
};
|
||||
return true;
|
||||
} catch (\Exception $e) {
|
||||
$subscriber->setError($e->getMessage());
|
||||
$subscriber->setError(__('Something went wrong with your subscription. Please contact the website owner.', 'mailpoet'));
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
@@ -69,7 +69,7 @@ class ConfirmationEmailMailerTest extends \MailPoetTest {
|
||||
|
||||
$sender->sendConfirmationEmail($subscriber);
|
||||
// error is set on the subscriber model object
|
||||
expect($subscriber->getErrors()[0])->equals('send error');
|
||||
expect($subscriber->getErrors()[0])->equals('Something went wrong with your subscription. Please contact the website owner.');
|
||||
}
|
||||
|
||||
function testItDoesntSendWhenMSSIsActiveAndConfirmationEmailIsNotAuthorized() {
|
||||
|
Reference in New Issue
Block a user