This commit replaces window.mailpoet_tracking_enabled variable with
tracking config object that carries the level and configuration for
all tracking options (emailsTrackingEnabled, cookieTrackingEnabled).
The window.mailpoet_tracking_enabled is confusing since it is not obvious what type of tracking is enabled.
[MAILPOET-3185]
We want to allow users to adjust tracking settings also on the WooCommerce setup Wizard.
In case they choose to disable cookie tracking we set the lowest from current_value and 'partial'.
[MAILPOET-3185]
In order to load correct global styles even when the feature for using MailPoet's Woo template is off, we need to make sure we always apply filters before we load woo styles.
[MAILPOET-3645]
This commit fixes a problem in the logic used to decide whether or not
the HelpScout chat should be available on the MailPoet admin pages. Before,
we were displaying the chat for plans that include premium support and access
to MSS. But we also have plans, like the Blogger plan, that include
premium support, and should see the chat, but don't include access to
MSS. Those plans were not seeing the chat.
This was happening because the code was checking just for
`mailpoet_api_key_state.data.support_tier == 'premium'`. The
mailpoet_api_key_state setting is added to the database based on the
response from the bridge.mailpoet.com/me endpoint. This endpoint returns
a 403 error for plans that don't include the sending service.
In this commit, to fix this problem, the code now checks for both
`mailpoet_api_key_state.data.support_tier == 'premium'` and
`premium_key_state.data.support_tier == 'premium'`. The former setting
is added to the database based on the response of the
bridge.mailpoet.com/premium endpoint. This endpoint works for plans that
have access to MailPoet Premium, but don't have access to MSS. We need to
check for both settings as we also have some plans that include the
sending service, but don't include MailPoet Premium.
[MAILPOET-3438]