Link to MSS signup with prefilled email address [MAILPOET-2484]
This commit is contained in:
@ -113,7 +113,7 @@ class Newsletters {
|
||||
$data['premium_plugin_active'] = License::getLicense();
|
||||
$data['is_woocommerce_active'] = $this->woocommerce_helper->isWooCommerceActive();
|
||||
$data['is_mailpoet_update_available'] = array_key_exists(Env::$plugin_path, $this->wp->getPluginUpdates());
|
||||
$data['subscribers_count'] = Subscriber::getTotalSubscribers();
|
||||
$data['subscriber_count'] = Subscriber::getTotalSubscribers();
|
||||
$data['mailpoet_feature_flags'] = $this->features_controller->getAllFlags();
|
||||
|
||||
if (!$data['premium_plugin_active']) {
|
||||
|
@ -4,17 +4,23 @@ namespace MailPoet\AdminPages\Pages;
|
||||
|
||||
use MailPoet\AdminPages\PageRenderer;
|
||||
use MailPoet\Models\Subscriber;
|
||||
use MailPoet\WP\Functions as WPFunctions;
|
||||
|
||||
class Premium {
|
||||
/** @var PageRenderer */
|
||||
private $page_renderer;
|
||||
|
||||
function __construct(PageRenderer $page_renderer) {
|
||||
/** @var WPFunctions */
|
||||
private $wp;
|
||||
|
||||
function __construct(PageRenderer $page_renderer, WPFunctions $wp) {
|
||||
$this->page_renderer = $page_renderer;
|
||||
$this->wp = $wp;
|
||||
}
|
||||
|
||||
function render() {
|
||||
$data = [
|
||||
'current_wp_user' => $this->wp->wpGetCurrentUser()->to_array(),
|
||||
'subscriber_count' => Subscriber::getTotalSubscribers(),
|
||||
];
|
||||
$this->page_renderer->displayPage('premium.html', $data);
|
||||
|
@ -4,17 +4,23 @@ namespace MailPoet\AdminPages\Pages;
|
||||
|
||||
use MailPoet\AdminPages\PageRenderer;
|
||||
use MailPoet\Models\Subscriber;
|
||||
use MailPoet\WP\Functions as WPFunctions;
|
||||
|
||||
class SubscribersAPIKeyInvalid {
|
||||
/** @var PageRenderer */
|
||||
private $page_renderer;
|
||||
|
||||
function __construct(PageRenderer $page_renderer) {
|
||||
/** @var WPFunctions */
|
||||
private $wp;
|
||||
|
||||
function __construct(PageRenderer $page_renderer, WPFunctions $wp) {
|
||||
$this->page_renderer = $page_renderer;
|
||||
$this->wp = $wp;
|
||||
}
|
||||
|
||||
function render() {
|
||||
$this->page_renderer->displayPage('invalidkey.html', [
|
||||
'current_wp_user' => $this->wp->wpGetCurrentUser()->to_array(),
|
||||
'subscriber_count' => Subscriber::getTotalSubscribers(),
|
||||
]);
|
||||
}
|
||||
|
@ -50,7 +50,8 @@ class WelcomeWizard {
|
||||
'finish_wizard_url' => $this->wp->adminUrl('admin.php?page=' . Menu::MAIN_PAGE_SLUG),
|
||||
'sender' => $this->settings->get('sender'),
|
||||
'admin_email' => $this->wp->getOption('admin_email'),
|
||||
'subscribers_count' => Subscriber::getTotalSubscribers(),
|
||||
'current_wp_user' => $this->wp->wpGetCurrentUser()->to_array(),
|
||||
'subscriber_count' => Subscriber::getTotalSubscribers(),
|
||||
'has_mss_key_specified' => Bridge::isMSSKeySpecified(),
|
||||
];
|
||||
$data['mailpoet_feature_flags'] = $this->features_controller->getAllFlags();
|
||||
|
@ -10,7 +10,7 @@
|
||||
</p>
|
||||
|
||||
<p>
|
||||
<a class="button button-primary" target="_blank" href="<%= add_referral_id('https://account.mailpoet.com?s=' ~ subscriber_count) %>"><%= __('Visit MailPoet.com to purchase a key') %></a>
|
||||
<a class="button button-primary" target="_blank" href="<%= add_referral_id("https://account.mailpoet.com/?s=" ~ subscriber_count ~ "&email=" ~ current_wp_user.user_email) | escape('html_attr') %>"><%= __('Visit MailPoet.com to purchase a key') %></a>
|
||||
</p>
|
||||
</div>
|
||||
<% endblock %>
|
||||
|
@ -29,7 +29,7 @@
|
||||
|
||||
var has_mss_key_specified = <%= json_encode(has_mss_key_specified) %>;
|
||||
var MSS_pitch_illustration_url = '<%= cdn_url('welcome-wizard/illu-pitch-mss.20190912.png') %>';
|
||||
var mailpoet_account_url = '<%= add_referral_id("https://account.mailpoet.com/?s=" ~ subscribers_count) %>';
|
||||
var mailpoet_account_url = '<%= add_referral_id("https://account.mailpoet.com/?s=" ~ subscriber_count ~ "&email=" ~ current_wp_user.user_email) | escape('js') %>';
|
||||
var mailpoet_feature_flags = <%= json_encode(mailpoet_feature_flags) %>;
|
||||
|
||||
var mailpoet_woocommerce_active = <%= json_encode(is_woocommerce_active) %>;
|
||||
@ -49,7 +49,7 @@
|
||||
var mailpoet_mss_active = <%= json_encode(mss_active) %>;
|
||||
var mailpoet_mta_method = '<%= settings.mta.method %>';
|
||||
var mailpoet_editor_javascript_url = '<%= getJavascriptScriptUrl("newsletter_editor.js") %>';
|
||||
var mailpoet_subscribers_count = <%= subscribers_count %>;
|
||||
var mailpoet_subscribers_count = <%= subscriber_count %>;
|
||||
|
||||
<% if not(premium_plugin_active) %>
|
||||
var mailpoet_free_premium_subscribers_limit = <%= free_premium_subscribers_limit %>;
|
||||
|
@ -18,7 +18,7 @@
|
||||
<div class="mailpoet-premium-page-intro-link-wrap">
|
||||
<a
|
||||
target="_blank"
|
||||
href="<%= add_referral_id('https://account.mailpoet.com?s=' ~ subscriber_count ~ '&utm_source=plugin&utm_medium=premium&utm_campaign=purchase') %>"
|
||||
href="<%= add_referral_id("https://account.mailpoet.com/?s=" ~ subscriber_count ~ "&email=" ~ current_wp_user.user_email ~ '&utm_source=plugin&utm_medium=premium&utm_campaign=purchase') | escape('html_attr') %>"
|
||||
class="premium-button"
|
||||
>
|
||||
<%= _x('Upgrade', 'This text resides in the Premium page: /wp-admin/admin.php?page=mailpoet-premium') %>
|
||||
@ -37,7 +37,7 @@
|
||||
</h3>
|
||||
<a
|
||||
target="_blank"
|
||||
href="<%= add_referral_id('https://account.mailpoet.com?s=' ~ subscriber_count ~ '&utm_source=plugin&utm_medium=premium&utm_campaign=purchase') %>"
|
||||
href="<%= add_referral_id("https://account.mailpoet.com/?s=" ~ subscriber_count ~ "&email=" ~ current_wp_user.user_email ~ '&utm_source=plugin&utm_medium=premium&utm_campaign=purchase') | escape('html_attr') %>"
|
||||
class="premium-button"
|
||||
>
|
||||
<%= _x('Sign up for free', 'This text resides in the Premium page: /wp-admin/admin.php?page=mailpoet-premium') %>
|
||||
@ -143,7 +143,7 @@
|
||||
<div class="mailpoet-premium-page-options-divider"></div>
|
||||
<a
|
||||
target="_blank"
|
||||
href="<%= add_referral_id('https://account.mailpoet.com?s=' ~ subscriber_count ~ '&utm_source=plugin&utm_medium=premium&utm_campaign=purchase') %>"
|
||||
href="<%= add_referral_id("https://account.mailpoet.com/?s=" ~ subscriber_count ~ "&email=" ~ current_wp_user.user_email ~ '&utm_source=plugin&utm_medium=premium&utm_campaign=purchase') | escape('html_attr') %>"
|
||||
class="premium-button"
|
||||
>
|
||||
<%= _x('Get started', 'This text resides in the Premium page: /wp-admin/admin.php?page=mailpoet-premium') %>
|
||||
@ -164,7 +164,7 @@
|
||||
<div class="mailpoet-premium-page-options-divider"></div>
|
||||
<a
|
||||
target="_blank"
|
||||
href="<%= add_referral_id('https://account.mailpoet.com?s=' ~ subscriber_count ~ '&utm_source=plugin&utm_medium=premium&utm_campaign=purchase') %>"
|
||||
href="<%= add_referral_id("https://account.mailpoet.com/?s=" ~ subscriber_count ~ "&email=" ~ current_wp_user.user_email ~ '&utm_source=plugin&utm_medium=premium&utm_campaign=purchase') | escape('html_attr') %>"
|
||||
class="premium-button"
|
||||
>
|
||||
<%= _x('Get started', 'This text resides in the Premium page: /wp-admin/admin.php?page=mailpoet-premium') %>
|
||||
@ -192,7 +192,7 @@
|
||||
</ul>
|
||||
<a
|
||||
target="_blank"
|
||||
href="<%= add_referral_id('https://account.mailpoet.com?s=' ~ subscriber_count ~ '&utm_source=plugin&utm_medium=premium&utm_campaign=purchase') %>"
|
||||
href="<%= add_referral_id("https://account.mailpoet.com/?s=" ~ subscriber_count ~ "&email=" ~ current_wp_user.user_email ~ '&utm_source=plugin&utm_medium=premium&utm_campaign=purchase') | escape('html_attr') %>"
|
||||
class="premium-button"
|
||||
>
|
||||
<%= _x('Buy Now (currently 33% discount)', 'This text resides in the Premium page: /wp-admin/admin.php?page=mailpoet-premium') %>
|
||||
@ -274,7 +274,7 @@
|
||||
</h3>
|
||||
<a
|
||||
target="_blank"
|
||||
href="<%= add_referral_id('https://account.mailpoet.com?s=' ~ subscriber_count ~ '&utm_source=plugin&utm_medium=premium&utm_campaign=purchase') %>"
|
||||
href="<%= add_referral_id("https://account.mailpoet.com/?s=" ~ subscriber_count ~ "&email=" ~ current_wp_user.user_email ~ '&utm_source=plugin&utm_medium=premium&utm_campaign=purchase') | escape('html_attr') %>"
|
||||
class="premium-button"
|
||||
>
|
||||
<%= _x('Upgrade now', 'This text resides in the Premium page: /wp-admin/admin.php?page=mailpoet-premium') %>
|
||||
|
@ -15,8 +15,8 @@
|
||||
var sender_data = <%= json_encode(sender) %>;
|
||||
var admin_email = <%= json_encode(admin_email) %>;
|
||||
var hide_mailpoet_beacon = true;
|
||||
var subscribers_count = <%= subscribers_count %>;
|
||||
var mailpoet_account_url = '<%= add_referral_id("https://account.mailpoet.com/?s=" ~ subscribers_count) %>';
|
||||
var subscribers_count = <%= subscriber_count %>;
|
||||
var mailpoet_account_url = '<%= add_referral_id("https://account.mailpoet.com/?s=" ~ subscriber_count ~ "&email=" ~ current_wp_user.user_email) | escape('js') %>';
|
||||
var has_mss_key_specified = <%= json_encode(has_mss_key_specified) %>;
|
||||
var mailpoet_feature_flags = <%= json_encode(mailpoet_feature_flags) %>;
|
||||
</script>
|
||||
|
Reference in New Issue
Block a user