' . esc_html($label) . ''); return $links; } /** Under the description, until the site is connected: where a free AguMail account starts. */ function agumail_onboarding_row_meta($meta, $file = '') { if ($file !== plugin_basename(AGUMAIL_FILE) || agumail_has_api_key() || !current_user_can(AGUMAIL_ADMIN_CAPABILITY)) { return $meta; } $meta[] = '' . esc_html__('Create a free AguMail account', 'agumail') . ' ' . esc_html__('(opens in a new tab)', 'agumail') . ''; return $meta; } // ───────────────────────────────────────────────────────────────────────────── // The connect notice. Its button starts the one-click connect straight away; // Dismiss is an admin action, so it passes the same nonce and capability // checks as every other. // ───────────────────────────────────────────────────────────────────────────── /** Whether the notice belongs on the screen being drawn. */ function agumail_onboarding_notice_due() { if (!current_user_can(AGUMAIL_ADMIN_CAPABILITY) || agumail_has_api_key() || get_option('agumail_connect_notice_dismissed') === 'yes') { return false; } return agumail_onboarding_screen_due(); } /** The Dashboard and the Plugins screen only. The AguMail page says it all already. */ function agumail_onboarding_screen_due() { $screen = function_exists('get_current_screen') ? get_current_screen() : null; return $screen && !empty($screen->id) && in_array($screen->id, array('dashboard', 'plugins'), true); } /** * A store connects in one click from the notice; any other site goes to the * AguMail page, where it connects with a key. Both offer a free account. */ function agumail_onboarding_notice() { if (!agumail_onboarding_notice_due()) { return; } $signup = '' . esc_html__('Create a free account', 'agumail') . ' ' . esc_html__('(opens in a new tab)', 'agumail') . ' '; if (agumail_woocommerce_active()) { $text = esc_html__('Connect AguMail to start syncing your customers, orders and carts.', 'agumail'); $start = '' . esc_html__('Connect to AguMail', 'agumail') . ' '; } else { $text = esc_html__('Grow your email list with AguMail: signup forms, popups and the forms you already have, with welcome emails that send themselves.', 'agumail'); $start = '' . esc_html__('Get started', 'agumail') . ' '; } echo '
' . $text . '
' // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped -- escaped above. . $start . $signup // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped -- built from escaped parts above. . '' . esc_html__('Dismiss', 'agumail') . '' . '
' . esc_html__('AguMail paused store sync: your plan does not include it.', 'agumail') . ' ' . esc_html__('Signups, forms and checkout subscribers keep going to AguMail. Orders and products wait, and go once your plan includes store sync.', 'agumail') . '
' . '' . esc_html__('See plans', 'agumail') . ' ' . esc_html__('(opens in a new tab)', 'agumail') . ' ' . $dismiss . '
' . esc_html__('AguMail can sync your store too.', 'agumail') . ' ' . esc_html__('Recover abandoned carts, see the revenue your emails bring in and put your products in emails. Store sync is on AguMail\'s Commerce plans; your forms and signups keep working either way.', 'agumail') . '
' . '' . esc_html__('See plans', 'agumail') . ' ' . esc_html__('(opens in a new tab)', 'agumail') . ' ' . $dismiss . '
' . esc_html__('AguMail store sync is back on. Orders and products that waited are on their way.', 'agumail') . ' ' . $dismiss . '
' . esc_html__('Your AguMail plan now includes store sync.', 'agumail') . ' ' . esc_html__('Sync your store to recover abandoned carts and see the revenue your emails bring in.', 'agumail') . '
' . '' . esc_html__('Sync your store', 'agumail') . ' ' . $dismiss . '