• Home
  • Demo
  • Buy Now
RISE - Ultimate Project Manager & CRM
    RISE - Ultimate Project Manager & CRMInstallation & MaintenancePersonalizationSettingsClient ManagementInvoices & PaymentsProjects & TasksTeam & CollaborationProductivity ToolsSales & ServicesPluginsFAQChange logs
Mailbox PluginEasy Backup PluginSquare Payment Method PluginLogin as Client PluginAsset Management Plugin2 Factor Authentication PluginPassword Manager PluginSocial Login PluginGoogle Meet Integration PluginSpreadsheets PluginZoom Integration Plugin
  1. Docs
  2. Mailbox Plugin

Mailbox - For developers: hooks

Other plugins can extend Mailbox with these hooks (add them in your plugin's index.php). Mailbox never calls an AI service itself: the button hooks are the place to add AI features like "Summarise" or "Draft a reply".

FilterWhere the button showsContextButton types
mailbox_conversation_actionsToolbar of an open conversationthread_id, account_id, folder_idmodal, link
mailbox_message_actionsNext to Reply on each emailmessage_id, thread_id, account_idmodal, link
mailbox_compose_actionsFooter of the compose windowaccount_id, mode, source_id, draft_idinsert

A button is an array: title (required), url (required, made with get_uri(); only "link" buttons may use another https URL), icon (a Feather icon, default "zap") and type. modal opens your URL in a RISE modal and posts the context, link opens it in a new tab with the context in the query string, insert posts the whole compose form.

app_hooks()->add_filter("mailbox_conversation_actions", function ($buttons, $context) {
    $buttons[] = array(
        "title" => "Summarise",
        "icon" => "cpu",
        "type" => "modal",
        "url" => get_uri("my_ai/summarise_modal") //receives thread_id, account_id, folder_id
    );
    return $buttons;
}, 10, 2);

Always check access in your own controller, because the ids come from the browser:

$access = new \Mailbox\Module\Libraries\Mailbox_access($this->login_user);
if (!$access->can_access_mailbox($account_id)) {
    app_redirect("forbidden");
}

An insert button gets the compose form (account_id, to, cc, bcc, subject, body, mode, source_id, draft_id) and answers with JSON:

echo json_encode(array(
    "success" => true,
    "html" => "

Thanks for your email...

", "mode" => "insert", //"insert" = above the current text, "replace" = the whole body "message" => "" //optional success message ));


HookTypeWhen / value
mailbox_message_receivedActionA new email was saved by the sync. Data: message_id, thread_id, account_id, folder_id, folder_role, direction.
mailbox_message_sentActionAn email was sent from RISE. Data: message_id, thread_id, account_id, user_id.
mailbox_incoming_connectorsFiltertype => class implementing Mailbox\Module\Libraries\Mail\Contracts\Incoming_connector. Also implement Contracts\Backfill_connector (fetch_older()) so the first import takes the newest emails first.
mailbox_outgoing_connectorsFiltertype => class implementing Mailbox\Module\Libraries\Mail\Contracts\Outgoing_connector.
mailbox_oauth_providersFiltertype => class extending Mailbox\Module\Libraries\Mail\Oauth\Oauth_provider (type: lower case letters, numbers and _).

The actions run inside the sync and the send request: keep them fast. Errors in your code are logged and don't stop the sync. Classes that don't exist or don't follow the contract are ignored. Mailbox also adds the notification event mailbox_new_email with the recipient term mailbox_members; on RISE versions without register_notification_event, Mailbox works without notifications.

Was this article helpful? Yes No
How can we improve this article?
© 2026 Fairsketch
Home Get Support Buy Now

Delete?

Are you sure? You won't be able to undo this action!
To do