Add MailPoet.hasValidMSSKey

I added the property so that we can check all combinations.
Currently it is not used but was added for completeness.
[MAILPOET-5191]
This commit is contained in:
Rostislav Wolny
2023-04-27 14:59:08 +02:00
committed by Veljko V
parent 600c83943c
commit 080b6a57ef
4 changed files with 5 additions and 0 deletions

View File

@@ -102,6 +102,7 @@ interface Window {
mailpoet_has_valid_api_key: boolean;
mailpoet_has_valid_premium_key: string;
mailpoet_mss_key_invalid: boolean;
mailpoet_mss_key_valid: boolean;
mailpoet_mta_method: string;
mailpoet_date_offset: string;
mailpoet_time_format: string;

View File

@@ -31,6 +31,8 @@ export const MailPoet = {
hasValidApiKey: window.mailpoet_has_valid_api_key,
// The key is valid and has access to premium features
hasValidPremiumKey: window.mailpoet_has_valid_premium_key,
// The key is valid and has access to MSS
hasValidMssApiKey: window.mailpoet_mss_key_valid,
// The key is invalid and has no access to MSS
hasInvalidMssApiKey: window.mailpoet_mss_key_invalid,
mtaMethod: window.mailpoet_mta_method,

View File

@@ -162,6 +162,7 @@ class PageRenderer {
'has_premium_support' => $this->subscribersFeature->hasPremiumSupport(),
'has_mss_key_specified' => Bridge::isMSSKeySpecified(),
'mss_key_invalid' => $this->servicesChecker->isMailPoetAPIKeyValid() === false,
'mss_key_valid' => $this->subscribersFeature->hasValidMssKey(),
'mss_key_pending_approval' => $this->servicesChecker->isMailPoetAPIKeyPendingApproval(),
'mss_active' => $this->bridge->isMailpoetSendingServiceEnabled(),
'plugin_partial_key' => $this->servicesChecker->generatePartialApiKey(),

View File

@@ -99,6 +99,7 @@ jQuery('#adminmenu #toplevel_page_mailpoet-newsletters')
var mailpoet_has_premium_support = <%= json_encode(has_premium_support) %>;
var has_mss_key_specified = <%= json_encode(has_mss_key_specified) %>;
var mailpoet_mss_key_invalid = <%= json_encode(mss_key_invalid) %>;
var mailpoet_mss_key_valid = <%= json_encode(mss_key_valid) %>;
var mailpoet_mss_key_pending_approval = '<%= mss_key_pending_approval %>';
var mailpoet_mss_active = <%= json_encode(mss_active) %>;
var mailpoet_plugin_partial_key = '<%= plugin_partial_key %>';