Skip to content

Commit 6959977

Browse files
committed
change schedule reminder method signature
1 parent 3c50b44 commit 6959977

File tree

1 file changed

+12
-1
lines changed

1 file changed

+12
-1
lines changed

src/Resources/WebsiteConversations.php

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44

55
namespace Ziming\LaravelCrisp\Resources;
66

7+
use Carbon\CarbonInterface;
78
use Crisp\CrispClient;
89
use Crisp\CrispException;
910
use Psr\Http\Client\ClientExceptionInterface;
@@ -246,8 +247,18 @@ public function setBlock(string $sessionId, bool $blocked = true): array
246247
* @throws CrispException
247248
* @throws ClientExceptionInterface
248249
*/
249-
public function scheduleReminder(string $sessionId, array $params): array
250+
public function scheduleReminder(string $sessionId, string|CarbonInterface $date, string $note): array
250251
{
252+
$params = [
253+
'note' => $note,
254+
];
255+
256+
if ($date instanceof CarbonInterface) {
257+
$params['date'] = $date->toIso8601String();
258+
} else {
259+
$params['date'] = $date;
260+
}
261+
251262
return $this->client->websiteConversations->scheduleReminder(
252263
config('crisp.website_id'),
253264
$sessionId,

0 commit comments

Comments
 (0)