diff --git a/includes/service-providers/mailchimp/class-newspack-newsletters-mailchimp.php b/includes/service-providers/mailchimp/class-newspack-newsletters-mailchimp.php index 55ff4cee1..26f824876 100644 --- a/includes/service-providers/mailchimp/class-newspack-newsletters-mailchimp.php +++ b/includes/service-providers/mailchimp/class-newspack-newsletters-mailchimp.php @@ -1574,12 +1574,10 @@ function( $value, $key ) { // Get and match existing merge fields. try { - $existing_fields = $mc->get( - "lists/$audience_id/merge-fields", - [ - 'count' => 1000, - ], - 60 + $existing_fields = $mc->get( "lists/$audience_id/merge-fields", [ 'count' => 1000 ], 60 ); + $result = $this->validate( + $existing_fields, + __( 'Error fetching Mailchimp merge fields.', 'newspack_newsletters' ) )['merge_fields']; } catch ( \Exception $e ) { do_action(