diff --git a/example/config.json b/example/config.json index f4c5cdc..1e2beb0 100644 --- a/example/config.json +++ b/example/config.json @@ -38,8 +38,14 @@ { "message": { - "success":"Good, enter your message:", - "failure":"Something went wrong, try again later!" + "success": + [ + "Good, enter your message:" + ], + "failure": + [ + "Something went wrong, try again later!" + ] }, "debug": { @@ -51,8 +57,14 @@ { "message": { - "success":"Thanks, your message successfully sent!", - "failure":"Something went wrong, please make your feedback!" + "success": + [ + "Thanks, your message successfully sent!" + ], + "failure": + [ + "Something went wrong, please make your feedback!" + ] }, "debug": { diff --git a/src/server.php b/src/server.php index a8bda78..8cbcfa3 100644 --- a/src/server.php +++ b/src/server.php @@ -154,8 +154,8 @@ $server->setPending( ); } - return is_null($code) || $code == trim($request) ? $config->nps->action->pending->message->success . PHP_EOL - : $config->nps->action->pending->message->failure . PHP_EOL; + return is_null($code) || $code == trim($request) ? implode(PHP_EOL, $config->nps->action->pending->message->success) . PHP_EOL + : implode(PHP_EOL, $config->nps->action->pending->message->failure) . PHP_EOL; } ); @@ -207,8 +207,8 @@ $server->setHandler( ); } - return $success ? $config->nps->action->handler->message->success . PHP_EOL - : $config->nps->action->handler->message->failure . PHP_EOL; + return $success ? implode(PHP_EOL, $config->nps->action->handler->message->success) . PHP_EOL + : implode(PHP_EOL, $config->nps->action->handler->message->failure) . PHP_EOL; } );