VAT
Your cart

Your cart is empty.

Inbox hooks

This page lists the 13 hooks of this group. Each entry shows its type, the version it arrived in, where it runs, its arguments and a starting point.

addochat_addofy_notifications

FilterSince 0.1.0 Runs in src/Inbox/Screen.php.

Filters whether Addofy's notifications replace the desktop notifications of the inbox.

ArgumentTypeDescription
$addofyboolDefault: adba_alerts_browser() for the current user (Addofy 2.36.0+), else whether Addofy runs with its notifications API.
add_filter( 'addochat_addofy_notifications', function ( $addofy ) {
	return $addofy;
} );

addochat_agent_replied

ActionSince 0.1.0 Runs in src/Inbox/Actions.php.

Fires after a colleague answered.

ArgumentTypeDescription
$conversationarray<string, mixed>Conversation row.
$message_idintMessage id.
$user_idintColleague.
add_action( 'addochat_agent_replied', function ( $conversation, $message_id, $user_id ) {
	// ...
}, 10, 3 );

addochat_agent_roles

FilterSince 0.1.0 Runs in src/Inbox/Agents.php.

Filters the roles that may answer chats. Applied on activation, on each upgrade and when the settings are saved; a role that is not in the list loses the capability.

ArgumentTypeDescription
$rolesstring[]Role names, from the setting "Roles that answer chats".
add_filter( 'addochat_agent_roles', function ( $roles ) {
	return $roles;
} );

addochat_agents_online

FilterSince 0.1.0 Runs in src/Inbox/Agents.php.

Filters whether a colleague is online for visitors (for example opening hours or a shared phone line).

ArgumentTypeDescription
$onlineboolWhether a colleague is online.
add_filter( 'addochat_agents_online', function ( $online ) {
	return $online;
} );

addochat_can_edit_message

FilterSince 0.2.0 Runs in src/Inbox/Actions.php.

Filters whether a colleague may edit a message in the inbox.

ArgumentTypeDescription
$allowedboolOwn answer, or any colleague answer for an administrator.
$messagearray<string, mixed>Message.
$user_idintColleague.
add_filter( 'addochat_can_edit_message', function ( $allowed, $message, $user_id ) {
	return $allowed;
}, 10, 3 );

addochat_conversation_claimed

ActionSince 0.1.0 Runs in src/Inbox/Actions.php.

Fires after a colleague took a conversation.

ArgumentTypeDescription
$conversationarray<string, mixed>Conversation row (before the change).
$user_idintColleague.
add_action( 'addochat_conversation_claimed', function ( $conversation, $user_id ) {
	// ...
}, 10, 2 );

addochat_conversation_closed

ActionSince 0.1.0 Runs in src/Inbox/Actions.php.

Fires after a conversation was closed.

ArgumentTypeDescription
$conversationarray<string, mixed>Conversation row (before the change).
$user_idintColleague.
add_action( 'addochat_conversation_closed', function ( $conversation, $user_id ) {
	// ...
}, 10, 2 );

addochat_delivery

FilterSince 0.1.0 Runs in src/Inbox/Actions.php.

Filters how a message from the inbox reaches the conversation. Return a subclass of \Addochat\Inbox\Delivery, for example to send it on to another site.

ArgumentTypeDescription
$delivery\Addochat\Inbox\DeliveryDelivery.
$conversationarray<string, mixed>Conversation row.
add_filter( 'addochat_delivery', function ( $delivery, $conversation ) {
	return $delivery;
}, 10, 2 );

addochat_is_open

FilterSince 0.1.0 Runs in src/Inbox/Hours.php.

Filters whether live chat is open at a moment. False means visitors get the email form straight away.

ArgumentTypeDescription
$openboolWhether it is open.
$now\DateTimeImmutableThe moment, in the WordPress time zone.
$settingsarray<string, mixed>Effective settings of the site.
add_filter( 'addochat_is_open', function ( $open, $now, $settings ) {
	return $open;
}, 10, 3 );

addochat_message_edited

ActionSince 0.2.0 Runs in src/Inbox/Actions.php.

Fires after a colleague changed the text of a message.

ArgumentTypeDescription
$conversationarray<string, mixed>Conversation row.
$message_idintMessage id.
$oldstringText before.
$textstringText now.
$user_idintColleague.
add_action( 'addochat_message_edited', function ( $conversation, $message_id, $old, $text, $user_id ) {
	// ...
}, 10, 5 );

addochat_opening_hours

FilterSince 0.1.0 Runs in src/Inbox/Hours.php.

Filters the opening hours of live chat, for example to read them from your own roster.

ArgumentTypeDescription
$schedulearray<string, mixed>days: 1 (Monday) to 7 => [start, end] in minutes after midnight, or null when closed; closed: dates (Y-m-d); set: false when no day was filled in (always open).
$settingsarray<string, mixed>Effective settings of the site.
add_filter( 'addochat_opening_hours', function ( $schedule, $settings ) {
	return $schedule;
}, 10, 2 );

FilterSince 0.2.0 Runs in src/Inbox/Links.php.

Filters a link in the inbox to something a conversation used: change the label, the detail line or the address (for example to another admin screen), or return null to leave it out.

ArgumentTypeDescription
$linkarray{label: string, detail: string, url: string}|nullLink, null when the object is gone.
$typestringorder, product, customer or page.
$idintId.
add_filter( 'addochat_ref_link', function ( $link, $type, $id ) {
	return $link;
}, 10, 3 );

addochat_single_view_url

FilterSince 0.2.0 Runs in src/Inbox/Screen.php.

Filters the address of the separate window with one conversation. The inbox adds "#<uuid>".

ArgumentTypeDescription
$urlstringAddress without the conversation.
add_filter( 'addochat_single_view_url', function ( $url ) {
	return $url;
} );

Ready to connect your AI to real tools?

Start free trial