With System messages, you can notify your agents of the updates that occur for a ticket when there are changes to a ticket's status, assignee, or priority.
Note: You can customize your system messages in Settings > System messages on the Sendbird Dashboard.
Distinguish system messages from notifications
When a client app receives a system message through the channel(_:didReceive:) method of BaseChannelDelegate, system messages can be distinguished from notifications by looking at the value of message.customType. Also their subtype is specified in message.data as shown below.
{
"message_id" : 40620745,
"type": "ADMM",
"custom_type": "SENDBIRD_DESK_ADMIN_MESSAGE_CUSTOM_TYPE",
"data": "{\"type\": \"SYSTEM_MESSAGE_TICKET_ASSIGNED_BY_SYSTEM\", \"ticket\": <Ticket Object>}",
...
"message": "The ticket is automatically assigned to Cindy.",
...
}
Note: The transfer property appears only when the message.data property has the value of SYSTEM_MESSAGE_TICKET_TRANSFERRED_BY_AGENT.
Hide system messages
As system messages deliver updates of a ticket, they are intended to be displayed to agents only. To hide system messages from your app, refer to the following code snippet.
public static func isVisible(message: BaseMessage) -> Bool {
if let message = message as? AdminMessage, let data = Data(base64Encoded: message.data), data.isEmpty == false {
let isSystemMessage = (message.customType == "ADMIN_MESSAGE_CUSTOM_TYPE")
let dataObject = try? JSONSerialization.jsonObject(with: data, options: []) as? [String: Any]
let type = dataObject?["type"] as? String
return !isSystemMessage &&
type != EVENT_TYPE_ASSIGN &&
type != EVENT_TYPE_TRANSFER &&
type != EVENT_TYPE_CLOSE
}
return true
}
List of system messages
System messages are designed to indicate the reason of the update. The following table covers the valid values specified in the message.data.type property and their default messages.
Note: Default messages can be edited in Settings > System messages on your dashboard.
List of message.data.type and default messages
message.data.type
Default message
SYSTEM_MESSAGE_TICKET_ACTIVE_TO_IDLE_BY_AGENT
The ticket status is changed from Active to Idle by {by_agent_name}.
SYSTEM_MESSAGE_TICKET_ACTIVE_TO_IDLE_BY_SYSTEM
The ticket status is automatically changed from Active to Idle.
SYSTEM_MESSAGE_TICKET_ASSIGNED_BY_AGENT
The ticket is assigned to {to_agent_name} by {by_agent_name}.
SYSTEM_MESSAGE_TICKET_ASSIGNED_BY_SYSTEM
The ticket is assigned to {agent.display_name} by the system.
SYSTEM_MESSAGE_TICKET_CLOSED_BY_AGENT
The ticket is closed by {by_agent_name}.
SYSTEM_MESSAGE_TICKET_CLOSED_BY_CUSTOMER
The ticket is closed by the customer.
SYSTEM_MESSAGE_TICKET_CLOSED_BY_PLATFORM_API
The ticket is closed by the Platform API.
SYSTEM_MESSAGE_TICKET_CLOSED_BY_SYSTEM
The ticket is automatically closed.
SYSTEM_MESSAGE_TICKET_GROUP_ASSIGNED_BY_AGENT
The ticket is assigned to the {to_team_name} team by {by_agent_name}.
SYSTEM_MESSAGE_TICKET_GROUP_TRANSFERRED_BY_AGENT
The ticket is transferred from {from_team_name} to the {to_team_name} team by {by_agent_name}.