Plentymarkets interface documentation
Messenger
Contracts
MessengerRepositoryContract
The MessengerRepositoryContract is the interface for the messenger repository. This interface defines methods to add and show/list messages.
Namespace
Plenty\Modules\Messenger\Contracts
Methods
public add($data):Plenty\Modules\Messenger\Models\Message
Return type: Message
Creates a new message.
Name |
Type |
Description |
|
The message data to be loaded |
public show($uuid):void
Gets a message with all its successors.
Name |
Type |
Description |
|
The UUID5 of the message |
public list($uuid = null, $successors = true, $amount = self::DEFAULT_MESSAGES_AMOUNT):array
Lists messages. If no reference UUID5 is given, the method returns the $amount first messages. If $successor is set to FALSE, the messages older than the referenced message will be returned.
Name |
Type |
Description |
|
The reference UUID5 of the message to start from (excluding). If not set, the uuid of the newest message will be used. |
|
|
If set to FALSE, the messages older than the referenced message will be returned. |
|
|
The amount of messages to list (defaults to 50) |
public listConversationMessages($conversationUuid, $isDeleted = false):Plenty\Repositories\Models\PaginatedResult
Return type: PaginatedResult
Lists messages for a single conversation
Name |
Type |
Description |
|
||
|
public listArchivedMessages($conversationUuid):Plenty\Repositories\Models\PaginatedResult
Return type: PaginatedResult
Lists messages for an archived conversation
Name |
Type |
Description |
|
public getMessages($page = self::DEFAULT_PAGE_OF_MESSAGES, $itemsPerPage = self::DEFAULT_ITEMS_PER_PAGE_OF_MESSAGES):array
Lists messages.
Name |
Type |
Description |
|
The number of the returned page of messages, default is 1 (the first) |
|
|
The amount of messages to list (defaults to 50) |
public updateReadBy($readBy, $uuid):void
Updates the readBy array of the message.
Name |
Type |
Description |
|
The ID of the user who read the message |
|
|
The UUID of the message |
Updates the tags of the message.
Name |
Type |
Description |
|
Array of tag IDs of the message |
|
|
The UUID of the message |
public updateVisibility($data, $uuid):void
Updates the visibility of the message. Attributes that are updated are Message.visibility, Message.linkedTo and Message.accessFor.
Name |
Type |
Description |
|
The message with the data to be updated |
|
|
The UUID of the messages |
public updateControls($data, $uuid):Plenty\Modules\Messenger\Models\Message
Return type: Message
Updates the message ui control options in the message meta data and returns the message.
Name |
Type |
Description |
|
The controls data to be updated. |
|
|
The uuid of the message. |
public setDone($doneAt = null, $uuid):void
Sets the doneAt date in the message. If $doneAt is NULL, the doneAt date will be reset.
Name |
Type |
Description |
|
The doneAt date as ISO date string |
|
|
The UUID of the message |
public delete($uuid):int
Deletes a message stream by the UUID. Returns the count of messages deleted.
Name |
Type |
Description |
|
The UUID of the message |
public getAttachment($uuid, $filename):Plenty\Modules\Messenger\Models\Attachment
Return type: Attachment
Gets a message attachment.
Name |
Type |
Description |
|
The UUID of the message |
|
|
The file name of the attachment |
public getAllAttachments($uuid):Plenty\Modules\Messenger\Models\Attachment
Return type: Attachment
Gets all message attachments as zip.
Name |
Type |
Description |
|
The UUID of the message |
public updateMetaData($uuid, $metaData):Plenty\Modules\Messenger\Models\Message
Return type: Message
Updates the meta data of the message.
Name |
Type |
Description |
|
The UUID of the message |
|
|
The meta data of the message |
public getTotalEntries():int
Returns total message entries
public setFilters($filters = []):void
Sets the filter array.
Name |
Type |
Description |
|
public getFilters():void
Returns the filter array.
public getConditions():void
Returns a collection of parsed filters as Condition object
public clearFilters():void
Clears the filter array.
Events
MessageCreated
The event is triggered after a new message was created.
Namespace
Plenty\Modules\Messenger\Events
Methods
public isFirstMessage():bool
If TRUE, the message is the first one. Otherwise, it is a reply message.
public broadcastWhen():void
public getMessage():Plenty\Modules\Messenger\Models\Message
Return type: Message
Get the message.
Models
Attachment
The Attachment model of the messenger.
Namespace
Plenty\Modules\Messenger\Models
Name | Type | Description |
---|---|---|
name |
The file name of the attachment |
|
message |
The UUID of the message the attachment belongs to |
|
size |
The size of the attachment in bytes |
|
contentType |
The content type fo the attachment |
|
content |
The content of the attachment |
|
createdAt |
The createdAt date of the attachment |
Methods
public toArray()
Returns this model as an array.
Message
The Message model of the messenger.
Namespace
Plenty\Modules\Messenger\Models
Name | Type | Description |
---|---|---|
uuid |
The UUID5 identifier of the message |
|
plentyIdHash |
The plenty ID hash |
|
parentUuid |
The UUID5 of the parent message |
|
conversationId |
The UUID5 of the conversation |
|
linkedTo |
An array with MessageLinkedTo instances |
|
from |
The sender of the message as MessageFrom instance. |
|
to |
The user and role IDs and emails receiving the message |
|
whispered |
Whether the message is whispered (not visible for the contact/order linked to the message) or not |
|
tags |
An array with tag IDs assigned to the message |
|
title |
The title of the message |
|
preview |
The first two lines of the message without any markup |
|
message |
The content of the message |
|
plainMessage |
The content of the message as plain text |
|
attachedFilesCount |
The amount of attached files (readonly) |
|
referrer |
The message referrer |
|
metaData |
The meta data of the message |
|
doneAt |
The date the messages was set to done |
|
createdAt |
The creation date of the message |
|
updatedAt |
The date of the last update of the message |
|
deletedAt |
The date the message was deleted |
|
deletedBy |
The ID of the user who deleted the message |
|
attachments |
The message attachments |
|
categoryId |
The categoryID of the message/conversation |
|
typeId |
The typeID of the conversation |
|
typePosition |
The typePosition of the typeID |
|
statusId |
The statusID of the conversation |
|
statusPosition |
The statusPosition of statusID |
|
marketplacesMetadata |
The marketplace metadata |
Methods
public toArray()
Returns this model as an array.
MessageFrom
The MessageFrom model of the messenger.
Namespace
Plenty\Modules\Messenger\Models
Name | Type | Description |
---|---|---|
type |
The type of the from instance (one of {@link MessageTypesService::FROM_TYPE_USER}, {@link MessageTypesService::FROM_TYPE_CONTACT} and {@link MessageTypesService::FROM_TYPE_EMAIL}) |
|
value |
The value of the instance. For type {@link MessageTypesService::FROM_TYPE_EMAIL} it is a string (the email) and the id of the user or the contact otherwise. |
|
name |
An optional name for the instance, e.g. the real name for type {@link MessageTypesService::FROM_TYPE_EMAIL} |
Methods
public toArray()
Returns this model as an array.
MessageLinkedTo
The MessageLinkedTo model of the messenger.
Namespace
Plenty\Modules\Messenger\Models
Name | Type | Description |
---|---|---|
type |
The type of the link (one of {@link MessageTypesService::LINKED_TO_TYPE_MESSAGE}, {@link MessageTypesService::LINKED_TO_TYPE_ORDER}, {@link MessageTypesService::LINKED_TO_TYPE_CONTACT} and {@link MessageTypesService::LINKED_TO_TYPE_PAYMENT}) |
|
value |
The value of the link. For type {@link MessageTypesService::LINKED_TO_TYPE_MESSAGE} it is a string (uuid5) and an integer otherwise. |
|
typeId |
This can be the ID of a sub-type (e.g. the order subTypeId). (optional) |
Methods
public toArray()
Returns this model as an array.
MessageMetaData
The MessageMetaData model of the messenger.
Namespace
Plenty\Modules\Messenger\Models
Name | Type | Description |
---|---|---|
readBy |
The array of users |
|
links |
Array with links |
|
notDoneByBackend |
deactivates the toggle button in the messenger ui (backend) also has optional tooltips (reason for the deactivated toggle) |
|
controls |
An object with control options for the ui. |
|
timeCapture |
An object of the message time capture data |
|
plentyId |
the plenty id of the related contact |
Methods
public toArray()
Returns this model as an array.
MessageMetaDataControls
The message controls model. Currently supported controls: * <ul> * <li><tt>bool replyable</tt> * Indicates whether or not is allowed to reply to this message stream (default true). * It is a global control and effects only in the parent message of a stream.</li> * <li><tt>bool attachable</tt> * Indicates whether or not is allowed to attach files in a message (default true). * It is a global control and effects only in the parent message of a stream.</li> * <li><tt>bool linksDisabled</tt> * Indicates whether or not the message links should be disabled (default false). * It is a loacal control and effects every message.</li> * </ul>
Namespace
Plenty\Modules\Messenger\Models
Name | Type | Description |
---|---|---|
replyable |
Indicates whether or not is allowed to reply to this message stream (default true). |
|
attachable |
Indicates whether or not is allowed to attach files in a message (default true). |
|
linksDisabled |
Indicates whether or not the message links should be disabled (default false). |
Methods
public toArray()
Returns this model as an array.
MessageMetaDataNotDone
The MessageMetaDataNotDone model of the messenger.
Namespace
Plenty\Modules\Messenger\Models
Name | Type | Description |
---|---|---|
deactivated |
Deactivates the toggle button for the UI |
|
tooltips |
Tooltips for the UI to show why the toggle is deactivated (if not set, show default values) |
Methods
public toArray()
Returns this model as an array.
MessageMetaDataTimeCapture
The MessageMetaDataTimeCapture model of the messenger.
Namespace
Plenty\Modules\Messenger\Models
Name | Type | Description |
---|---|---|
chargeable |
||
minutes |
Methods
public toArray()
Returns this model as an array.
MessageMetaLink
The MessageMetaLink model of the messenger.
Namespace
Plenty\Modules\Messenger\Models
Name | Type | Description |
---|---|---|
image |
An optional image URL for the link |
|
caption |
The caption to be shown for the link |
|
url |
The link URL <ul> <li>for {@link MessageMetaLink::TYPE_MAILTO} the email</li> <li>for {@link MessageMetaLink::TYPE_URL} the complete URL with protocol</li> <li>for {@link MessageMetaLink::TYPE_PLUGIN} the relative route to the backend</li> <li>not needed for {@link MessageMetaLink::TYPE_REPLY}</li> </ul> |
|
type |
One of the constants: <ul> <li>{@link MessageMetaLink::TYPE_MAILTO}</li> <li>{@link MessageMetaLink::TYPE_URL}</li> <li>{@link MessageMetaLink::TYPE_PLUGIN}</li> <li>{@link MessageMetaLink::TYPE_REPLY}</li> </ul> |
|
content |
The reply content, only needed for type {@link MessageMetaLink::TYPE_REPLY} |
Methods
public toArray()
Returns this model as an array.
MessageReferrer
The MessageReferrer model of the messenger.
Namespace
Plenty\Modules\Messenger\Models
Name | Type | Description |
---|---|---|
type |
The type of the from instance (one of {@link MessageTypesService::REFERRER_TYPE_SYSTEM}, {@link MessageTypesService::REFERRER_TYPE_BACKEND}, {@link MessageTypesService::REFERRER_TYPE_REST}, {@link MessageTypesService::REFERRER_TYPE_EMAIL} and {@link MessageTypesService::REFERRER_TYPE_PLUGIN}) |
|
value |
The value of the instance. It is an integer (the user id) for type {@link MessageTypesService::REFERRER_TYPE_SYSTEM}, {@link MessageTypesService::REFERRER_TYPE_EMAIL}, {@link MessageTypesService::REFERRER_TYPE_BACKEND} and {@link MessageTypesService::REFERRER_TYPE_REST} and a string (the plugin name) for type {@link MessageTypesService::REFERRER_TYPE_PLUGIN}. |
|
name |
An optional name for the instance. For type {@link MessageTypesService::REFERRER_TYPE_PLUGIN} it is the plugin namespace, the user name otherwise. |
Methods
public toArray()
Returns this model as an array.
MessageTo
The MessageTo model of the messenger.
Namespace
Plenty\Modules\Messenger\Models
Name | Type | Description |
---|---|---|
user |
An array with user IDs of users receiving the message |
|
role |
An array with user role IDs of user roles receiving the message |
|
An array with emails receiving the message |
||
allUsers |
Flag indicating that all system users receive the message |
|
contacts |
A snapshot of the contacts from conversation→conversationRecipients |
|
orders |
A snapshot of the orders from conversation→conversationRecipients |
|
emails |
A snapshot of the emails from conversation→conversationRecipients |
Methods
public toArray()
Returns this model as an array.
Services
MessageTypesService
Types and type validation for several types in the messenger.
Namespace
Plenty\Modules\Messenger\Services
Methods
public static getValidLinkedToTypes():array
Gets the valid types for "linked to" references.
public static isValidLinkedTo($linkType, $linkValue):bool
Checks whether the given link is valid or not.
Name |
Type |
Description |
|
The link type |
|
|
The link value |
public static getValidFromTypes():array
Gets the valid types for "from" references.
public static isValidFrom($fromType, $fromValue):bool
Checks whether the given from is valid or not.
Name |
Type |
Description |
|
The from type |
|
|
The from value |
public static getValidReferrerTypes():array
Gets the valid types for "referrer" references.
public static isValidReferrer($referrerType, $referrerValue, $referrerName = null):bool
Checks whether the given referrer reference is valid or not.
Name |
Type |
Description |
|
The reference to be checked |
|
|
The value of the reference |
|
|
The name of the reference |
public static getValidToTypes():array
Gets the valid key types for the 'to' array.
public static isValidTo($toKey):bool
Checks whether the given key has a valid value for to.
Name |
Type |
Description |
|
The to key |
MessagesSearchService
Search service for the messenger.
Namespace
Plenty\Modules\Messenger\Services
Methods
public find($uuid):Plenty\Modules\Messenger\Models\Message
Return type: Message
Gets the message with the given uuid.
Name |
Type |
Description |
|
The UUID of the message |
public findOrFail($uuid):Plenty\Modules\Messenger\Models\Message
Return type: Message
Gets the message with the given UUID.
Name |
Type |
Description |
|
The UUID of the message |
public findMany($uuid):array
Gets a stream of messages. The given UUID can be the UUID of the first message in the stream or one of the replied messages.
Name |
Type |
Description |
|
The UUID of the message |
Lists the messages for the given navigation page.
Name |
Type |
Description |
|
The page of results to search for |
|
|
The number of items to list per page |
public getTotalEntries():int
Returns total entries
public static loadMessage($path):Plenty\Modules\Messenger\Models\Message
Return type: Message
Get an instance of the model.
Name |
Type |
Description |
|
Name |
Type |
Description |
|
public findByConversationId($conversationUuid):array
Gets a stream of messages. The given UUID can be the UUID of the first message in the stream or one of the replied messages.
Name |
Type |
Description |
|
The UUID of the message |
public toArray():array
public process($data):array
Name |
Type |
Description |
|
public getFilter():array
public getPostFilter():array
public getQuery():array
public getAggregations():array
public getSuggestions():array
public getSources():void
public addDependenciesToSource($sources):void
Name |
Type |
Description |
|
public getName():void
public setName($name):void
Name |
Type |
Description |
|
public setIsSourceDisabled($isSourceDisabled):void
Name |
Type |
Description |
|
public setTrackTotalHits($trackTotalHits):void
Name |
Type |
Description |
|
public addFilter($filter):Plenty\Modules\Cloud\ElasticSearch\Lib\Search\BaseSearch
Return type: BaseSearch
Name |
Type |
Description |
|
public addPostFilter($filter):Plenty\Modules\Cloud\ElasticSearch\Lib\Search\BaseSearch
Return type: BaseSearch
Name |
Type |
Description |
|
public addQuery($query):Plenty\Modules\Cloud\ElasticSearch\Lib\Search\BaseSearch
Return type: BaseSearch
Name |
Type |
Description |
|
public addSource($source):Plenty\Modules\Cloud\ElasticSearch\Lib\Search\BaseSearch
Return type: BaseSearch
Name |
Type |
Description |
|
public setSorting($sorting):Plenty\Modules\Cloud\ElasticSearch\Lib\Search\BaseSearch
Return type: BaseSearch
Name |
Type |
Description |
|
public addAggregation($aggregation):Plenty\Modules\Cloud\ElasticSearch\Lib\Search\BaseSearch
Return type: BaseSearch
Name |
Type |
Description |
|
public addSuggestion($suggestion):Plenty\Modules\Cloud\ElasticSearch\Lib\Search\BaseSearch
Return type: BaseSearch
Name |
Type |
Description |
|
public setPage($page, $rowsPerPage):Plenty\Modules\Cloud\ElasticSearch\Lib\Search\BaseSearch
Return type: BaseSearch
Name |
Type |
Description |
|
||
|
public setPagination($pagination):void
Name |
Type |
Description |
|
public setCollapse($collapse):void
Name |
Type |
Description |
|
public setScoreModifier($scoreModifier):Plenty\Modules\Cloud\ElasticSearch\Lib\Search\BaseSearch
Return type: BaseSearch
Name |
Type |
Description |
|
public setMaxResultWindow($maxResults = 10000):void
Name |
Type |
Description |
|
public setIndex($index):void
Name |
Type |
Description |
|
public isSearchAfter():void
public getFilterRaw():void
public getQueriesRaw():void
public getAggregationsRaw():array
public getSorting():void
public getScoreModifier():void
Conversations
Contracts
ConversationCategoryRepositoryContract
The ConversationCategoryRepositoryContract is the interface for the messenger conversations categories. This interface defines methods to add, update and show categories.
Namespace
Plenty\Modules\Messenger\Conversations\Contracts
Methods
public getCategory($id):Plenty\Modules\Messenger\Conversations\Models\ConversationCategory
Return type: ConversationCategory
Retrieves a category based on ID
Name |
Type |
Description |
|
Category ID |
public createCategory($categoryData):Plenty\Modules\Messenger\Conversations\Models\ConversationCategory
Return type: ConversationCategory
Creates a new category
Name |
Type |
Description |
|
Array with category properties |
public updateCategory($id, $data):Plenty\Modules\Messenger\Conversations\Models\ConversationCategory
Return type: ConversationCategory
Updates an existing category
Name |
Type |
Description |
|
Category ID |
|
|
Array with cateogry properties |
public updateCategoryStatus($id, $isEnabled):Plenty\Modules\Messenger\Conversations\Models\ConversationCategory
Return type: ConversationCategory
Name |
Type |
Description |
|
||
|
public listCategories($page, $itemsPerPage, $sortBy, $sortOrder, $filters = []):Plenty\Repositories\Models\PaginatedResult
Return type: PaginatedResult
Lists all categories based on provided filters
Name |
Type |
Description |
|
Page number |
|
|
Number of results per page |
|
|
Sort column (id, position) |
|
|
Sort order (asc/desc) |
|
|
Array with filters (isDeleted, typeId, id, name) |
public deleteCategory($id):bool
Deletes a category (soft delete)
Name |
Type |
Description |
|
Status ID |
public batchDeleteCategories($categoryIds):bool
Deletes a batch of categories
Name |
Type |
Description |
|
ConversationFolderRepositoryContract
The ConversationFolderRepositoryContract is the interface for the messenger conversations folders. This interface defines methods to add, update and show folders.
Namespace
Plenty\Modules\Messenger\Conversations\Contracts
Methods
public getFolder($uuid):Plenty\Modules\Messenger\Conversations\Models\ConversationFolder
Return type: ConversationFolder
Retrieves a folder object based on UUID
Name |
Type |
Description |
|
The UUID of the folder |
public createFolder($data):Plenty\Modules\Messenger\Conversations\Models\ConversationFolder
Return type: ConversationFolder
Creates a new folder. Important! The userId property will be automatically set based on the current logged in user.
Name |
Type |
Description |
|
Array with folder properties |
public updateFolder($uuid, $data):Plenty\Modules\Messenger\Conversations\Models\ConversationFolder
Return type: ConversationFolder
Updates an existing folder.
Name |
Type |
Description |
|
Folder UUID |
|
|
Array with folder properties |
public listFolders($userId, $page, $itemsPerPage, $sortBy, $sortOrder):Plenty\Repositories\Models\PaginatedResult
Return type: PaginatedResult
Returns a paginated result with all folders
Name |
Type |
Description |
|
ID of the folder owner |
|
|
Page number |
|
|
Items per page |
|
|
Sort column |
|
|
Sort order |
public deleteFolder($uuid):bool
Deletes a folder
Name |
Type |
Description |
|
The UUID of the deleted folder |
ConversationRepositoryContract
The ConversationRepositoryContract is the interface for the messenger conversations repository. This interface defines methods to add, update and show conversations.
Namespace
Plenty\Modules\Messenger\Conversations\Contracts
Methods
public listConversations($request):array
List all conversations and returns a paginated result
Name |
Type |
Description |
|
List of filters, page number, items per page and "with" array |
public searchConversations($getFilters, $postFilters):array
List all conversations and returns a paginated result
Name |
Type |
Description |
|
||
|
public createConversation($data):Plenty\Modules\Messenger\Conversations\Models\Conversation
Return type: Conversation
Creates a new conversation
Name |
Type |
Description |
|
Conversation data |
public getConversation($uuid5, $with = []):Plenty\Modules\Messenger\Conversations\Models\Conversation
Return type: Conversation
Retrieves a conversation
Name |
Type |
Description |
|
Conversation UUID |
|
|
Array with extra relations (possible values: ["messages"]) |
public updateConversation($uuid5, $data):Plenty\Modules\Messenger\Conversations\Models\Conversation
Return type: Conversation
Updates a conversation
Name |
Type |
Description |
|
Conversation UUID |
|
|
Conversation data. If a property key is missing, the old value will be kept. |
public updateClose($uuids, $isClosed):int
Sets a batch of conversations closed status
Name |
Type |
Description |
|
Array of conversations UUID’s |
|
|
Close status (true/false) |
Update the list of tags for a conversation
Name |
Type |
Description |
|
Conversation UUID |
|
|
Array of tag ID’s |
Adds to a batch of conversations new tags. The list of tags will be extra added to the existing list of tags for each conversation
Name |
Type |
Description |
|
Array of conversations UUID’s |
|
|
Array of tag ID’s |
public updateDeadline($uuids, $deadline = null):int
Sets deadline for a batch of conversations
Name |
Type |
Description |
|
Array of conversations UUID’s |
|
|
Deadline in format YYYY-MM-DD H:i:s. If null is set, the deadline will be removed |
public updateFollowUpDate($uuids, $followUpDate = null):int
Sets follow up date for a batch of conversations
Name |
Type |
Description |
|
Array of conversations UUID’s |
|
|
Follow up date in format YYYY-MM-DD H:i:s. If null is set, the follow up date will be removed |
public updateRead($uuids, $userId, $read):int
Marks a batch of conversations as red/not read by the given user
Name |
Type |
Description |
|
Array of conversations UUID’s |
|
|
ID of the user |
|
|
Read status: true/false |
public batchResubmitConversations($uuids):int
Resubmits all conversations with follow up date today (resets read by array, resets follow up date)
Name |
Type |
Description |
|
Array of conversations UUID’s |
public addSubscribers($uuid, $userId):int
Subscribes a user to a conversation. A subscribed user will receive notifications related to that conversation (via email or in the admin notifications area)
Name |
Type |
Description |
|
Conversation UUID |
|
|
ID of the user |
public removeSubscribers($uuid, $userId):int
Unsubscribes a user from a conversation
Name |
Type |
Description |
|
Conversation UUID |
|
|
ID of the user |
public deleteConversation($uuid5):int
Soft deletes a conversation. Conversation will be visible in the trash folder.
Name |
Type |
Description |
|
Conversation UUID |
public batchDeleteConversations($uuids):int
Soft deletes a batch of conversations. Conversations will be visible in the trash folder.
Name |
Type |
Description |
|
List of conversations UUID’s separated by comma |
public searchReceiver($searchTerm, $companyId = null, $extraParams = []):array
Search and returns a list of possible receivers. Search is done by contact name, contact id, order ID, user ID, user name. Search term must have minimum 3 letters
Name |
Type |
Description |
|
The searched term |
|
|
The company ID for witch will make the search |
|
|
public getInboxes():array
Retrieves the list of configured inboxes. If the inbox is not active it will not be returned in the response.
public updatePriority($uuids, $priorityId):int
Sets priority for a batch of conversations
Name |
Type |
Description |
|
Array of conversations UUID’s |
|
|
Id of priority (0 - No priority, 1 - Very low, 2 - low, 3 - Medium, 4 - High, 5 - Very high) |
public updateConversationsTypeAndStatus($conversationsUuids, $typeId, $statusId):bool
Sets the type and status for a batch of conversations
Name |
Type |
Description |
|
Array of conversations UUID’s |
|
|
Type ID of conversation. If null is set, the conversation type will be removed. |
|
|
Status ID of conversation. If null is set, the conversation status will be removed. |
public getTotals():array
Returns the total number of unread conversations for current user
public emptyTrash($days = null):bool
Permanently deletes all the messages from trash older than $days (based on deleted at field). If days is null, all messages from trash will be permanently deleted. Emptying of the trash will be done immediately.
Name |
Type |
Description |
|
Minimum number of days since the conversation was moved to trash |
public queueEmptyTrash($days = null):bool
Adds the empty trash command to a queue. Emptying of the trash will happen sometime in the future, when the first worker is available to process the queue (less impact on Elastic Search index).
Name |
Type |
Description |
|
Minimum number of days since the conversation was moved to trash |
public archiveConversations($uuids, $isFromUI):int
Archives a batch of conversations. Conversations will be visible in archive folder (filter isArchive = true in list conversations)
Name |
Type |
Description |
|
Array of conversations UUID’s |
|
|
Flag that specifies if action is triggered from UI. If set to true, the action will be performed immediately. If set to false, the action will be queued (less impact on Elastic Search index) |
public restoreArchivedConversations($uuids):int
Restores a batch of conversations from the archive. The operation is performed immediately.
Name |
Type |
Description |
|
Array of conversations UUID’s |
public permanentlyDeleteArchivedConversations($uuids):int
Permanently deletes a batch of conversations from the archive
Name |
Type |
Description |
|
Array of conversations UUID’s. The operation is performed immediately. |
public batchRestoreConversations($uuids):int
Restores from trash a batch of conversations
Name |
Type |
Description |
|
Array of conversations UUID’s. The operation is performed immediately. |
public updateSubscribe($uuids):int
Subscribes current user to a batch of conversations
Name |
Type |
Description |
|
Array of conversations UUID’s. |
public updateUnsubscribe($uuids):int
Unsubscribes the current user from a batch of conversations
Name |
Type |
Description |
|
Array of conversations UUID’s. |
public automaticallyArchiveConversations($days):bool
Automatically archives conversations older than $days days. The updatedAt field is taken into consideration when calculating conversation age.
Name |
Type |
Description |
|
Minimum number of days since the conversation was last updated |
public updateConversationsFoldersRelations($conversationsUuids, $foldersUuids):bool
Assigns batch of conversation to batch of folders. The list of folders must belong to the current logged in user ID.
Name |
Type |
Description |
|
Array of conversations UUID’s |
|
|
Array of folders UUID’s |
public removeConversationFolders($conversationsUuid, $foldersUuidsToKeep):bool
Removes conversation from all folders except the ones passed to array $foldersUuidsToKeep. This operation will be performed only for folders belonging to current logged in user ID.
Name |
Type |
Description |
|
Conversation UUID |
|
|
Array of folders UUID’s to keep. If array is empty, conversation will be removed from all folders |
public addToFolders($conversationsUuids, $foldersUuids):bool
Add multiple conversations to multiple folders
Name |
Type |
Description |
|
The conversations UUIDs |
|
|
The folders UUIDs |
public removeFromFolders($conversationsUuids, $foldersUuids):bool
Remove multiple conversations from multiple folders
Name |
Type |
Description |
|
The conversations UUIDs |
|
|
The folders UUIDs |
public getHistoryByConversationUUID($UUID):array
Retrieves history for a conversation
Name |
Type |
Description |
|
public removeConversationRelation($conversationUuid, $type, $value, $removeRecipient = false):bool
Removes relation from a conversation
Name |
Type |
Description |
|
||
|
||
|
||
|
public addConversationRelation($conversationUuid, $emails, $contacts, $orders, $addToRecipients):bool
Adds relations to a conversation
Name |
Type |
Description |
|
||
|
||
|
||
|
||
|
public batchChangeGroup($uuids, $groupId):int
Changes group for a batch of conversations
Name |
Type |
Description |
|
||
|
ConversationRoleRepositoryContract
The ConversationRoleRepositoryContract is the interface for the messenger conversations roles. * This interface defines methods to add, update, delete and show roles.
Namespace
Plenty\Modules\Messenger\Conversations\Contracts
Methods
public getRoleById($roleId):Plenty\Modules\Messenger\Conversations\Models\Roles\ConversationRole
Return type: ConversationRole
Get role details by role id
Name |
Type |
Description |
|
ID of the role |
public listRoles($page = 1, $itemPerPage = 25, $sortBy = "id", $sortOrder = "asc", $filters = []):Plenty\Repositories\Models\PaginatedResult
Return type: PaginatedResult
Get paginated results for roles
Name |
Type |
Description |
|
Page number |
|
|
Items per page |
|
|
Column name to be sorted by |
|
|
Sort order |
|
|
public updateRole($roleId, $data):Plenty\Modules\Messenger\Conversations\Models\Roles\ConversationRole
Return type: ConversationRole
Update a role
Name |
Type |
Description |
|
The id of the role to be updated |
|
|
Aray with Role properties to be updated |
public deleteRole($roleId):bool
Delete a role
Name |
Type |
Description |
|
The id of the role to be deleted |
public createRole($data):Plenty\Modules\Messenger\Conversations\Models\Roles\ConversationRole
Return type: ConversationRole
Create new role
Name |
Type |
Description |
|
public batchDeleteRoles($roleIds):bool
Deletes a batch of roles
Name |
Type |
Description |
|
Array with role ID’s |
ConversationStatusRepositoryContract
The ConversationStatusRepositoryContract is the interface for the messenger conversations statuses. This interface defines methods to add, update and show statuses.
Namespace
Plenty\Modules\Messenger\Conversations\Contracts
Methods
public getStatus($id):Plenty\Modules\Messenger\Conversations\Models\ConversationStatus
Return type: ConversationStatus
Retrieves a status based on ID
Name |
Type |
Description |
|
Status ID |
public createStatus($statusData):Plenty\Modules\Messenger\Conversations\Models\ConversationStatus
Return type: ConversationStatus
Creates a new status
Name |
Type |
Description |
|
Array with status properties |
public updateStatus($id, $data):Plenty\Modules\Messenger\Conversations\Models\ConversationStatus
Return type: ConversationStatus
Updates an existing status
Name |
Type |
Description |
|
Status ID |
|
|
Array with status properties |
public listStatuses($page, $itemsPerPage, $sortBy, $sortOrder, $filters = []):Plenty\Repositories\Models\PaginatedResult
Return type: PaginatedResult
Lists all statuses based on provided filters
Name |
Type |
Description |
|
Page number |
|
|
Number of results per page |
|
|
Sort column (id, position) |
|
|
Sort order (asc/desc) |
|
|
Array with filters (isDeleted, typeId, id, name) |
public deleteStatus($id):bool
Deletes a status (soft delete)
Name |
Type |
Description |
|
Status ID |
public batchDeleteStatuses($statusIds):bool
Deletes a batch of statuses
Name |
Type |
Description |
|
Array with status ID’s |
ConversationTypeRepositoryContract
The ConversationTypeRepositoryContract is the interface for the messenger conversations types. This interface defines methods to add, update and show types.
Namespace
Plenty\Modules\Messenger\Conversations\Contracts
Methods
public getType($id):Plenty\Modules\Messenger\Conversations\Models\ConversationType
Return type: ConversationType
Retrieves a type based on ID
Name |
Type |
Description |
|
Type ID |
public createType($typeData):Plenty\Modules\Messenger\Conversations\Models\ConversationType
Return type: ConversationType
Creates a new type
Name |
Type |
Description |
|
Array with type properties |
public updateType($id, $typeData):Plenty\Modules\Messenger\Conversations\Models\ConversationType
Return type: ConversationType
TUpdates an existing type
Name |
Type |
Description |
|
Type ID |
|
|
Array with type properties |
public listTypes($page, $itemsPerPage, $sortBy, $sortOrder, $filters = [], $with = []):Plenty\Repositories\Models\PaginatedResult
Return type: PaginatedResult
Lists all types based on filters and returns a paginated result
Name |
Type |
Description |
|
Page number |
|
|
Number of results per page |
|
|
Sort column (id, position) |
|
|
Sort order (asc/desc) |
|
|
Array with filters (name, isDeleted, id) |
|
|
(allStatuses ,activeStatuses) |
public deleteType($id):bool
Deletes a type
Name |
Type |
Description |
|
Type ID |
public batchDeleteTypes($typeIds):bool
Deletes a batch of types
Name |
Type |
Description |
|
Array of type ID’s |
Events
DeadlineChangeConversationEvent
The event is triggered when the conversation deadline is changed.
Namespace
Plenty\Modules\Messenger\Conversations\Events
Methods
public getConversationUUID():void
MarkAsReadConversationEvent
The event is triggered when the conversation is marked as read.
Namespace
Plenty\Modules\Messenger\Conversations\Events
Methods
public getConversationUUID():void
NewConversationEvent
The event is triggered when a new conversation is created by a user (via UI or REST API).
Namespace
Plenty\Modules\Messenger\Conversations\Events
Methods
public getConversationUUID():void
NewEmailFromCustomerConversationEvent
The event is triggered when a new conversation is created by a customer (received via inbox).
Namespace
Plenty\Modules\Messenger\Conversations\Events
Methods
public getConversationUUID():void
NewReplyConversationEvent
The event is triggered when an user replyes to an existing conversation (via UI or REST API).
Namespace
Plenty\Modules\Messenger\Conversations\Events
Methods
public getConversationUUID():void
NewReplyFromCustomerConversationEvent
The event is triggered when the customer replyes to an existing conversation (reply received via inbox).
Namespace
Plenty\Modules\Messenger\Conversations\Events
Methods
public getConversationUUID():void
OrderAddedToReceiverListEvent
The event is triggered when the order is added to the receiver list of an existing conversation.
Namespace
Plenty\Modules\Messenger\Conversations\Events
Methods
public getConversationUUID():void
PriorityChangeConversationEvent
The event is triggered when the conversation priority is changed.
Namespace
Plenty\Modules\Messenger\Conversations\Events
Methods
public getConversationUUID():void
StatusChangeConversationEvent
The event is triggered when the conversation status is changed.
Namespace
Plenty\Modules\Messenger\Conversations\Events
Methods
public getConversationUUID():void
Models
Conversation
The Conversation model of the messenger.
Namespace
Plenty\Modules\Messenger\Conversations\Models
Name | Type | Description |
---|---|---|
uuid |
The UUID of the conversation |
|
shortId |
The Short ID of the Conversation |
|
plentyIdHash |
The plentyIdHash |
|
plentyId |
The plentyId of the relation contact |
|
inboxId |
The inboxId from the assistant |
|
title |
The Title of the Conversation |
|
conversationRelation |
The relations to other entities |
|
conversationRecipients |
The recipients of new Messages |
|
tagIds |
Array of tag IDs |
|
isClosed |
Boolean that indicates if the conversation is closed |
|
isDeleted |
Boolean that indicates if the conversation is deleted |
|
referrer |
Array of referrers |
|
readBy |
Array of user ids (int) |
|
subscribers |
Subscribers of the conversation |
|
createdAt |
Creation Date |
|
updatedAt |
Update Date |
|
deletedAt |
Deletion Date |
|
deadline |
Deadline Date |
|
followUpDate |
FollowUpDate Date |
|
messages |
Conversation messages |
|
attachmentsCount Attachment messages count |
||
billedMsgCount Conversation billed msg count |
||
billedMinutesCount Conversation billed minutes count |
||
validRelation Conversation has the relations validated |
||
priorityId |
The Priority of the Conversation |
|
from |
Conversation from |
|
typeId |
ID of conversation type |
|
typePosition |
Sort order of conversation type |
|
statusId |
ID of conversation status |
|
statusPosition |
Sort order of conversation status |
|
hasWhisperedMessages |
Flag that indicates if a conversation contains whispered messages |
|
messagesTitles |
Array of all message titles |
|
messagesBodies |
Array with all message bodies stripped of tags |
|
messagesTags |
Array with all tag ID’s from all messages |
|
messagesReferrers |
Array with all referrers from all messages |
|
messagesFroms |
Array with all from fields from all messages |
|
replyTo |
||
messagesPaths |
Array with s3 messages paths |
|
messagesIds |
Array with all messages UUID’s |
|
isMigratedToEs |
Flag that indicates if the conversation is synced to ES (used during messenger migration to new structure) |
|
isArchived |
Flag that indicates if the conversation is archived |
|
conversationPreview |
Strip last the message from messagesBodies to 200 characters, used for preview. |
|
categoryId |
Flag that indicates if the conversation is archived |
|
linkedFolders |
List of linked folders |
|
marketplacesMetadata |
marketplaces Meta data |
|
owners |
Conversation Owners |
Methods
public toArray()
Returns this model as an array.
ConversationCategory
The ConversationCategory model of the messenger.
Namespace
Plenty\Modules\Messenger\Conversations\Models
Name | Type | Description |
---|---|---|
names |
Collection of category names for different languages |
|
types |
Collection of types that belong to that category |
|
id |
The ID of the type |
|
position |
The position of the type (used in sorting) |
|
userId |
The user ID which performed the last update |
|
icon |
The icon for messenger tab |
|
iconType |
The icon type |
|
isDeleted |
Flag that indicates if the type was deleted |
|
isEnabled |
Flag that indicates if the type is enabled |
Methods
public toArray()
Returns this model as an array.
ConversationCategoryNames
The ConversationCategoryNames model of the messenger.
Namespace
Plenty\Modules\Messenger\Conversations\Models
Name | Type | Description |
---|---|---|
lang |
The language of the name |
|
name |
The category name |
Methods
public toArray()
Returns this model as an array.
ConversationFolder
The Conversation model of the messenger.
Namespace
Plenty\Modules\Messenger\Conversations\Models
Name | Type | Description |
---|---|---|
uuid |
The UUID of the folder |
|
name |
The name of the folder |
|
userId |
The user ID which is the folder owner |
Methods
public toArray()
Returns this model as an array.
ConversationFolderProperty
The ConversationFolderProperty model of the messenger.
Namespace
Plenty\Modules\Messenger\Conversations\Models
Name | Type | Description |
---|---|---|
userId |
||
foldersUuids |
Methods
public toArray()
Returns this model as an array.
ConversationFrom
The ConversationFrom model of the messenger.
Namespace
Plenty\Modules\Messenger\Conversations\Models
Name | Type | Description |
---|---|---|
type |
The type of the from instance (one of {@link ConversationFrom::FROM_TYPE_USER}, {@link ConversationFrom::FROM_TYPE_CONTACT} and {@link ConversationFrom::FROM_TYPE_EMAIL}) |
|
value |
The value of the instance. For type {@link ConversationFrom::FROM_TYPE_EMAIL} it is a string (the email) and the id of the user or the contact otherwise. |
|
name |
An optional name for the instance, e.g. the real name for type {@link ConversationFrom::FROM_TYPE_EMAIL} |
Methods
public toArray()
Returns this model as an array.
ConversationOwner
The ConversationOwners model of the messenger.
Namespace
Plenty\Modules\Messenger\Conversations\Models
Name | Type | Description |
---|---|---|
roleId |
The id of the role |
|
ownerId |
The user id value |
Methods
public toArray()
Returns this model as an array.
ConversationRelation
The ConversationRelation model of the messenger.
Namespace
Plenty\Modules\Messenger\Conversations\Models
Name | Type | Description |
---|---|---|
type |
The type of the relation (one of {@link ConversationRelation::RELATION_TYPE_CONTACT}, {@link ConversationRelation::RELATION_TYPE_ORDER}, {@link ConversationRelation::RELATION_TYPE_EMAIL}, {@link ConversationRelation::RELATION_TYPE_PAYMENT}) {@link ConversationRelation::RELATION_TYPE_USER}, {@link ConversationRelation::RELATION_AMAZON_ORDER}) {@link ConversationRelation::RELATION_TYPE_CONTACT_EMAIL}, {@link ConversationRelation::RELATION_TYPE_CONTACT_ID}) {@link ConversationRelation::RELATION_TYPE_CONTACT_NUMBER}, {@link ConversationRelation::RELATION_TYPE_INVOICE_NUMBER}) {@link ConversationRelation::RELATION_TYPE_ORDER_ID}), {@link ConversationRelation::RELATION_ORDER_EXTERNAL_ID}) |
|
value |
Array with entity values |
Methods
public toArray()
Returns this model as an array.
ConversationStatus
The ConversationStatus model of the messenger.
Namespace
Plenty\Modules\Messenger\Conversations\Models
Name | Type | Description |
---|---|---|
names |
Collection of status names for different languages |
|
id |
The ID of the status |
|
position |
The position of the status (used in sorting) |
|
userId |
The suer ID which performed the last update |
|
isDeleted |
Flag that indicates if the status was deleted |
|
typeId The ID of the parent type |
||
progress Percentage of progress (0, 10, 20, 30, 40, 50, 60, 70, 80, 90, 100) |
||
colour Color of the status background (example: #0084ff) |
Methods
public toArray()
Returns this model as an array.
ConversationStatusNames
The ConversationStatusNames model of the messenger.
Namespace
Plenty\Modules\Messenger\Conversations\Models
Name | Type | Description |
---|---|---|
lang |
The language of the name |
|
name |
The name of the status |
Methods
public toArray()
Returns this model as an array.
ConversationSubscribers
The ConversationSubscribers model of the messenger.
Namespace
Plenty\Modules\Messenger\Conversations\Models
Name | Type | Description |
---|---|---|
userIds |
The array of userIds subscribed to a message |
|
roleIds |
The array of roleIds subscribed to a message (not used) |
Methods
public toArray()
Returns this model as an array.
ConversationType
The ConversationType model of the messenger.
Namespace
Plenty\Modules\Messenger\Conversations\Models
Name | Type | Description |
---|---|---|
names |
Collection of type names for different languages |
|
statuses |
Collection of statuses that belong to that type |
|
id |
The ID of the type |
|
position |
The position of the type (used in sorting) |
|
userId |
The suer ID which performed the last update |
|
isDeleted |
Flag that indicates if the type was deleted |
|
categoryId |
The ID of the parent category |
Methods
public toArray()
Returns this model as an array.
ConversationTypeNames
The ConversationTypeNames model of the messenger.
Namespace
Plenty\Modules\Messenger\Conversations\Models
Name | Type | Description |
---|---|---|
lang |
The language of the name |
|
name |
The type name |
Methods
public toArray()
Returns this model as an array.
SearchReceiver
The Conversation model of the messenger.
Namespace
Plenty\Modules\Messenger\Conversations\Models
Name | Type | Description |
---|---|---|
id |
The ID of the entity |
|
name |
The name of the entity |
|
The email of the entity |
||
lang |
The lang of the entity |
|
externalId |
The external ID of the entity |
|
type |
The entity type |
Methods
public toArray()
Returns this model as an array.
Ebay
Contracts
EbayAccountsRepositoryContract
The EbayAccountsRepositoryContract is the interface for Merketplaces Ebay EbayAccount
Namespace
Plenty\Modules\Messenger\Conversations\Marketplaces\Ebay\Contracts
Methods
public listEbayAccounts():Illuminate\Support\Collection
Return type: Collection
Get all ebay accounts
public getActiveEbayAccounts():Illuminate\Support\Collection
Return type: Collection
Get all ebay active accounts
public createEbayAccount($data):Plenty\Modules\Messenger\Conversations\Marketplaces\Ebay\Models\EbayAccount
Return type: EbayAccount
Create a new Ebay account
Name |
Type |
Description |
|
public updateEbayAccounts($data):Illuminate\Support\Collection
Return type: Collection
Update an existing array of Ebay account settings
Name |
Type |
Description |
|
public deleteEbayAccount($accountSettingsId):bool
Delete an Ebay account (the account will be flagged with deleted=1) The action will not delete the account
Name |
Type |
Description |
|
public getEbayAccount($accountSettingsId):Plenty\Modules\Messenger\Conversations\Marketplaces\Ebay\Models\EbayAccount
Return type: EbayAccount
Get Ebay account details
Name |
Type |
Description |
|
Models
EbayAccount
The Ebay Settings model of the messenger.
Namespace
Plenty\Modules\Messenger\Conversations\Marketplaces\Ebay\Models
Name | Type | Description |
---|---|---|
id |
The id of the messenger ebay settings account |
|
ebayAccountId |
The id of the ebay account |
|
name |
The name of the ebay account |
|
isEnabled |
The status of the messenger ebay settings account |
|
isDeleted |
The deleted status of the messenger ebay settings account |
|
settings |
The list of settings of the messenger ebay settings account * |
Methods
public toArray()
Returns this model as an array.
MarketplacesMetaDataEbayProperties
The Ebay properties model of the messenger.
Namespace
Plenty\Modules\Messenger\Conversations\Marketplaces\Ebay\Models
Name | Type | Description |
---|---|---|
ebayCreatedAt |
The creation datetime |
|
ebaySenderName |
The name of the sender |
|
ebayMessageId |
The message id |
|
ebayExternalMessageId |
The external message id |
|
ebaySellerName |
The name of the seller |
|
ebayItemId |
The id of the item |
|
ebayItemEndTime |
The end time of the item |
|
ebayType |
Ebay message type |
|
ebayResponseEnabled |
Ebay response enabled/disabled |
|
ebayAccountId |
Ebay account ID |
|
ebayMessengerAccountId |
Messenger Ebay account ID |
Methods
public toArray()
Returns this model as an array.
Settings
The EbayAccount's settings model of the messenger.
Namespace
Plenty\Modules\Messenger\Conversations\Marketplaces\Ebay\Models
Name | Type | Description |
---|---|---|
markAsRead |
Mark the conversation as read |
|
defaultStatus |
The conversation’s default status |
|
defaultType |
The conversation’s default status |
Methods
public toArray()
Returns this model as an array.
Marketplaces
Models
TicketSystemMigration
Contracts
TicketMigrationStatusRepositoryContract
TicketMigrationRepositoryContract is the interface for the ticketMigrationStatus repository. * This interface allows to list, get, create ticketMigrationStatus.
Namespace
Plenty\Modules\Messenger\TicketSystemMigration\Contracts
Methods
public saveTicketMigrationStatus($data):bool
Adds a new ticketMigrationStatus entry
Name |
Type |
Description |
|
The ticketMigrationStatus data as array. |
Models
TicketMigrationStatus
The ticket migration status model.
Namespace
Plenty\Modules\Messenger\TicketSystemMigration\Models
Referenceable
id
Name | Type | Description |
---|---|---|
id |
The PK ID |
|
ticketId |
The ticket ID |
|
migrationStatus |
The status of the migration that took place: <ul> <li> failed </li> <li> migrated</li> </ul> |
|
errorMessage |
The details of the failed migration |
|
conversationId |
The new conversation Id that the ticket is mapped to |
|
createdAt |
The date the ticket status of the migration was created |
|
updatedAt |
The date the ticket status of the migration was last updated |
Methods
public toArray()
Returns this model as an array.