diff --git a/includes/class-newspack-newsletters-renderer.php b/includes/class-newspack-newsletters-renderer.php index 0a64e19ac..c1b78bec4 100644 --- a/includes/class-newspack-newsletters-renderer.php +++ b/includes/class-newspack-newsletters-renderer.php @@ -330,6 +330,14 @@ private static function render_mjml_component( $block, $is_in_column = false, $i break; + /** + * Spacer block. + */ + case 'core/spacer': + $attrs['height'] = $attrs['height'] . 'px'; + $block_mjml_markup .= ''; + break; + /** * Social links block. */ diff --git a/includes/class-newspack-newsletters.php b/includes/class-newspack-newsletters.php index b7cbbcc25..e1eaa8e2c 100644 --- a/includes/class-newspack-newsletters.php +++ b/includes/class-newspack-newsletters.php @@ -136,6 +136,7 @@ public static function newsletters_allowed_block_types( $allowed_block_types, $p return $allowed_block_types; } return array( + 'core/spacer', 'core/block', 'core/group', 'core/paragraph', @@ -321,7 +322,7 @@ public static function api_get_keys() { $mailchimp_api_key = self::mailchimp_api_key(); $mjml_api_key = get_option( 'newspack_newsletters_mjml_api_key', false ); $mjml_api_secret = get_option( 'newspack_newsletters_mjml_api_secret', false ); - + $keys = [ 'mailchimp_api_key' => $mailchimp_api_key, 'mjml_api_key' => $mjml_api_key, @@ -345,8 +346,8 @@ public static function api_set_keys( $request ) { $errors = []; if ( empty( $mailchimp_api_key ) ) { - $wp_error->add( - 'newspack_newsletters_invalid_keys_mailchimp', + $wp_error->add( + 'newspack_newsletters_invalid_keys_mailchimp', __( 'Please input a Mailchimp API key.', 'newspack-newsletters' ) ); } else { @@ -359,16 +360,16 @@ public static function api_set_keys( $request ) { if ( $ping ) { update_option( 'newspack_newsletters_mailchimp_api_key', $mailchimp_api_key ); } else { - $wp_error->add( - 'newspack_newsletters_invalid_keys_mailchimp', + $wp_error->add( + 'newspack_newsletters_invalid_keys_mailchimp', __( 'Please input a valid Mailchimp API key.', 'newspack-newsletters' ) ); } } if ( empty( $mjml_api_key ) || empty( $mjml_api_secret ) ) { - $wp_error->add( - 'newspack_newsletters_invalid_keys_mjml', + $wp_error->add( + 'newspack_newsletters_invalid_keys_mjml', __( 'Please input MJML application ID and secret key.', 'newspack-newsletters' ) ); } else { @@ -392,8 +393,8 @@ public static function api_set_keys( $request ) { update_option( 'newspack_newsletters_mjml_api_key', $mjml_api_key ); update_option( 'newspack_newsletters_mjml_api_secret', $mjml_api_secret ); } else { - $wp_error->add( - 'newspack_newsletters_invalid_keys_mjml', + $wp_error->add( + 'newspack_newsletters_invalid_keys_mjml', __( 'Please input valid MJML application ID and secret key.', 'newspack-newsletters' ) ); }