Split pending approval message into title and body

MAILPOET-5631
This commit is contained in:
John Oleksowicz
2023-10-13 11:59:04 -05:00
committed by Aschepikov
parent 4a4ecc8204
commit d531a8fb60

View File

@@ -36,20 +36,32 @@ class PendingApprovalNotice {
return null; return null;
} }
public function getPendingApprovalMessage(): string { public function getPendingApprovalTitle(): string {
// translators: %s is the email subject, which will always be in English $message = __("MailPoet is [link]reviewing your subscription[/link].", 'mailpoet');
$message = sprintf(__("MailPoet is [link1]reviewing your subscription[/link1]. You can use all MailPoet features and send [link2]email previews[/link2] to your [link3]authorized email addresses[/link3], but sending to your email list contacts is temporarily paused until we review your subscription. If you don't hear from us within 48 hours, please check the inbox and spam folders of your MailPoet account email for follow-up emails with the subject \"%s\" and reply, or [link4]contact us[/link4].", 'mailpoet'), 'Your MailPoet Subscription Review'); return Helpers::replaceLinkTags(
$message = Helpers::replaceLinkTags(
$message, $message,
'https://kb.mailpoet.com/article/379-our-approval-process', 'https://kb.mailpoet.com/article/379-our-approval-process',
[ [
'target' => '_blank', 'target' => '_blank',
], ],
'link'
);
}
public function getPendingApprovalBody(): string {
// translators: %s is the email subject, which will always be in English
$message = sprintf(__("You can use all MailPoet features and send [link1]email previews[/link1] to your [link2]authorized email addresses[/link2], but sending to your email list contacts is temporarily paused until we review your subscription. If you don't hear from us within 48 hours, please check the inbox and spam folders of your MailPoet account email for follow-up emails with the subject \"%s\" and reply, or [link3]contact us[/link3].", 'mailpoet'), 'Your MailPoet Subscription Review');
$message = Helpers::replaceLinkTags(
$message,
'https://kb.mailpoet.com/article/290-check-your-newsletter-before-sending-it',
[
'target' => '_blank',
],
'link1' 'link1'
); );
$message = Helpers::replaceLinkTags( $message = Helpers::replaceLinkTags(
$message, $message,
'https://kb.mailpoet.com/article/290-check-your-newsletter-before-sending-it', 'https://kb.mailpoet.com/article/266-how-to-add-an-authorized-email-address-as-the-from-address#how-to-authorize-an-email-address',
[ [
'target' => '_blank', 'target' => '_blank',
], ],
@@ -57,24 +69,20 @@ class PendingApprovalNotice {
); );
$message = Helpers::replaceLinkTags( $message = Helpers::replaceLinkTags(
$message, $message,
'https://kb.mailpoet.com/article/266-how-to-add-an-authorized-email-address-as-the-from-address#how-to-authorize-an-email-address', 'https://www.mailpoet.com/support/',
[ [
'target' => '_blank', 'target' => '_blank',
], ],
'link3' 'link3'
); );
$message = Helpers::replaceLinkTags(
$message,
'https://www.mailpoet.com/support/',
[
'target' => '_blank',
],
'link4'
);
return $message; return $message;
} }
public function getPendingApprovalMessage(): string {
return sprintf('%s %s', $this->getPendingApprovalTitle(), $this->getPendingApprovalBody());
}
private function display(): string { private function display(): string {
$message = $this->getPendingApprovalMessage(); $message = $this->getPendingApprovalMessage();
WPNotice::displayWarning($message, '', self::OPTION_NAME); WPNotice::displayWarning($message, '', self::OPTION_NAME);