add multi-line messages support

This commit is contained in:
ghost 2024-04-30 03:34:00 +03:00
parent 43ad262344
commit c547c67cf5
2 changed files with 20 additions and 8 deletions

View File

@ -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":
{

View File

@ -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;
}
);