diff --git a/lib/Newsletter/Shortcodes/ShortcodesHelper.php b/lib/Newsletter/Shortcodes/ShortcodesHelper.php index d6fb61f363..eb8aee78dc 100644 --- a/lib/Newsletter/Shortcodes/ShortcodesHelper.php +++ b/lib/Newsletter/Shortcodes/ShortcodesHelper.php @@ -118,7 +118,7 @@ class ShortcodesHelper { return array_map(function ($custom_field) { return array( 'text' => $custom_field->name, - 'shortcode' => 'subscriber:cf_' . $custom_field->id + 'shortcode' => '[subscriber:cf_' . $custom_field->id . ']' ); }, $custom_fields); } diff --git a/tests/unit/Newsletter/ShortcodesHelperTest.php b/tests/unit/Newsletter/ShortcodesHelperTest.php index 1fd0edca4a..38550c6b99 100644 --- a/tests/unit/Newsletter/ShortcodesHelperTest.php +++ b/tests/unit/Newsletter/ShortcodesHelperTest.php @@ -29,7 +29,7 @@ class ShortcodesHelperTest extends MailPoetTest { $custom_subscriber_shortcode = end($shortcodes['Subscriber']); expect($custom_subscriber_shortcode['text'])->equals($custom_field->name); expect($custom_subscriber_shortcode['shortcode']) - ->equals('subscriber:cf_' . $custom_field->id); + ->equals('[subscriber:cf_' . $custom_field->id . ']'); } function _after() {