Skip to content

Commit

Permalink
fix(sync): strip unsuffixed UTM meta keys from normalized contact data (
Browse files Browse the repository at this point in the history
#3623)

* fix(sync): strip unsuffixed UTM meta keys from normalized contact data

* fix: add CLI script for deleting Mailchimp merge fields

* feat: add CLI command to list found merge fields

* fix(ras): add script for fixing duplicate Mailchimp merge fields

* refactor: move Mailchimp CLI commands to their own class
  • Loading branch information
dkoo authored Dec 16, 2024
1 parent 359f743 commit 5bbcc7b
Show file tree
Hide file tree
Showing 4 changed files with 593 additions and 17 deletions.
16 changes: 16 additions & 0 deletions includes/cli/class-initializer.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ public static function init() {
include_once NEWSPACK_ABSPATH . 'includes/cli/class-ras.php';
include_once NEWSPACK_ABSPATH . 'includes/cli/class-ras-esp-sync.php';
include_once NEWSPACK_ABSPATH . 'includes/cli/class-co-authors-plus.php';
include_once NEWSPACK_ABSPATH . 'includes/cli/class-mailchimp.php';
include_once NEWSPACK_ABSPATH . 'includes/cli/class-woocommerce-subscriptions.php';
}

Expand Down Expand Up @@ -58,6 +59,21 @@ public static function register_comands() {
[ 'Newspack\CLI\RAS_ESP_Sync', 'cli_sync_contacts' ]
);

WP_CLI::add_command(
'newspack mailchimp merge-fields list',
[ 'Newspack\CLI\Mailchimp', 'cli_mailchimp_list_merge_fields' ]
);

WP_CLI::add_command(
'newspack mailchimp merge-fields delete',
[ 'Newspack\CLI\Mailchimp', 'cli_mailchimp_delete_merge_fields' ]
);

WP_CLI::add_command(
'newspack mailchimp merge-fields fix-duplicates',
[ 'Newspack\CLI\Mailchimp', 'cli_mailchimp_fix_duplicate_merge_fields' ]
);

WP_CLI::add_command( 'newspack migrate-co-authors-guest-authors', [ 'Newspack\CLI\Co_Authors_Plus', 'migrate_guest_authors' ] );
WP_CLI::add_command( 'newspack backfill-non-editing-contributors', [ 'Newspack\CLI\Co_Authors_Plus', 'backfill_non_editing_contributor' ] );
WP_CLI::add_command( 'newspack migrate-expired-subscriptions', [ 'Newspack\CLI\WooCommerce_Subscriptions', 'migrate_expired_subscriptions' ] );
Expand Down
Loading

0 comments on commit 5bbcc7b

Please sign in to comment.