Note added to existing conversation as created by account owner
Closed this issue · 2 comments
- PHP version: 7.4
- SDK version: 3.2.1
Current behavior
Hi,
When adding a note (or other threads ) to an existing conversation, it always the owner who is set as the creator of the note. Even if I use setCreatedByUser().
But it's working, when the note is added when conversation is created.
eg. $conversation->setThreads(new Collection($reply_thread,$note));
Maybe I'm not doing it the right way.
Steps to reproduce
My code:
$thread = new NoteThread();
$thread->setCreatedByUser($user);
$thread->setText($msg);
$thread->setStatus($status);
$client->threads()->create($conversation_id, $thread);
Thank you
Hey,
This is definitely a bit confusing. The NoteThread
is a multipurpose object that's used when creating threads and when fetching a conversation's threads. When creating, $thread->setUser()
or $thread->setUserId()
should be used to have this value set correctly. When fetching this thread $thread->getCreatedByUser()
should be used. Seems to be an unfortunate side effect of some design/reusability choices we made in the SDK, so I'm sorry about the confusion!
It's working! Thanks for the fast answer!