wiki:Plugin_Hooks

Version 2 (modified by thomasb, 4 years ago) (diff)

--

Available Plugin Hooks

The registered callback function receives a hash array as single argument which contains hook specific data (called Arguments in the following list). It can then alter some of these values (listed as Return values) by returning a hash array containing the modified values.

Global Hooks

startup

When the application is initialized.
This is the place where task and action arguments can be altered.

Arguments:

task, action

Return values:

task, action

authenticate

Before the user login on the IMAP server is performed.

Arguments:

host, user

Return values:

host, user, pass

create_user

When a somebody logs in the first time and a local user is created. Return values will also be used to create the default identity for this new user.

Arguments:

user, user_name, user_email

Return values:

user_name, user_email

Task "mail"

message_part_before

Triggered before a message part (text or html) is cleaned/formatted.

Arguments:

type,body,safe,plain,inline_html

Return values:

type,body,safe,plain,inline_html

message_part_after

After message text part formatting.

Arguments:

type,body,safe,plain,inline_html

Return values:

body

outgoing_message_headers

Before a mail message is sent, this hooks allows you to set additional mail headers.

Arguments:

headers: Hash array with current message headers

Return values:

headers

Task "addressbook"

TBD.

Task "settings"

TBD.

Template Hooks

The RoundCube skin retrieves certain parts (e.g. message list, folders list, etc.) from the application with special tags within the HTML templates: <roundcube:object name="someobject" ... />. Template hooks are triggered once a template object is rendered. A plugin can alter or extend the html content of a template object.

The hooks are named template_object_* where * is the name of the object. A list of all available template objects is given in Doc_TemplateObjects?.

Arguments:

content, [tag attributes]

Return values:

content