MailPoet adds a link to the WooCommerce task list pointing to its own
welcome wizard. We want to track users that arrive to the MP wizard from
WooCommerce but at this point tracking is not enabled. So we store the
information in a setting, and send the tracking event to Mixpanel, if it
is enabled, after the user completes the wizard.
[MAILPOET-4814]
When we create the templates, we are not in the WordPress environment and do not
have a connection to the database. Therefore, we need to instantiate our dependencies
later, so they get only invoked once they are needed, which is, when we are
in the WordPress environment again.
[MAILPOET-3985]
The specs for [MAILPOET-3324] had a minor error that is fixed by this
commit. The ranges for displaying different colors for the percentage of
clicks should be < 1%, 1-3% and > 3% instead of < 10%, 10-30% and > 30%.
[MAILPOET-3324]
This commit adds a helper function that will return a number with two
decimal digits if the number is smaller than 0.1 and will return a
number with one decimal digit if the number is equal to or greater than
0.1. It is used to format the numbers in the stats notification email.
[MAILPOET-3324]
The criteria used to determine the color used for clicked and opened
stats is the same, but we had one method to get the color of each stats.
This commit combines both methods into one to avoid duplication.
[MAILPOET-3324]
The method clickedStatsColor() should return different color codes
depending on the percentage of clicks (> 30%, < 30% and > 10%, < 10%).
It receives the percentage value as an absolute number. There was a bug
in this method where it was checking for values greater than 3, between
3 and 1, and smaller than 1 instead of greater than 30, between 30 and
10, and smaller than 10.
[MAILPOET-3324]