ACL notifications
acl_context_authenticated acl_is_allowed acl_is_allowed_prop acl_is_owner acl_logoff acl_logon acl_mqtt acl_user_groups acl_user_groups_modify…
Authentication notifications
auth_checked auth_confirm auth_confirm_done auth_client_logon_user auth_client_switch_user auth_identity_types auth_logon auth_logoff auth_options_update…
Dispatch notifications
content_types_dispatch dispatch dispatch_host dispatch_rewrite page_url url_abs url_rewrite
Edge notifications
edge_delete edge_insert edge_update
E-mail notifications
email_add_handler email_bounced email_dkim_options email_drop_handler email_ensure_handler email_failed email_is_blocked email_is_recipient_ok email_received…
Import/export notifications
import_csv_definition import_resource export_resource_content_disposition export_resource_content_type export_resource_data export_resource_encode…
Media notifications
media_identify_extension media_identify_file media_import media_import_medium media_preview_options media_import_props media_replace_file media_stillimage…
Pivot notifications
pivot_fields pivot_rsc_data pivot_update custom_pivot
Resource notifications
rsc_delete rsc_get rsc_import_fetch rsc_insert rsc_merge rsc_pivot_done rsc_query_item rsc_update rsc_update_done rsc_upload
Survey notifications
survey_get_handlers survey_is_allowed_results_download survey_is_submit survey_submit survey_result_columns survey_result_column_values
User notifications
identity_password_match identity_verification identity_verified identity_update_done logon_options logon_ready_page logon_submit set_user_language…
Other notifications
action_event_type activity activity_send admin_edit_blocks admin_menu admin_rscform category_hierarchy_save comment_insert content_security_header cors_headers…

Validators Reference Installation requirements

All Notifications

acl_mqtt

MQTT acl check, called via the normal acl notifications. Actions for these checks: subscribe, publish

media_import_props

Notification to translate or map a file after upload, before insertion into the database Used in mod_video to queue…

observe_acl_collab_groups_modify/3

Modify the list of collaboration groups of a user. Called internally by the ACL modules when fetching the list of…

observe_acl_context_authenticated/2

Set the context to a typical authenticated user. Used by m_acl.erl

observe_acl_is_allowed/2

Check if a user is authorized to perform an operation on a an object (some resource or module). Observe this…

observe_acl_is_allowed_prop/2

Check if a user is authorizded to perform an action on a property. Defaults to true .

observe_acl_is_owner/2

Check if a user is the owner of a resource. id is the resource id.

observe_acl_logoff/2

Clear the associated access policy for the context.

observe_acl_logon/2

Initialize context with the access policy for the user.

observe_acl_user_groups/2

Return the groups for the current user.

observe_acl_user_groups_modify/3

Modify the list of user groups of a user. Called internally by the ACL modules when fetching the list of user groups a…

observe_action_event_type/2

Render the javascript for a custom action event type. The custom event type must be a tuple, for example: `{% wire…

observe_activity/2

An activity in Zotonic. When this is handled as a notification then return a list of patterns matching this activity.

observe_activity_send/2

Push a list of activities via a ‘channel’ (eg ‘email’) to a recipient. The activities are a list of

observe_admin_edit_blocks/3

Used in the admin to fetch the possible blocks for display

observe_admin_menu/3

Used for fetching the menu in the admin.

observe_admin_rscform/3

Used in the admin to process a submitted resource form

observe_auth_checked/2

Notify after logon of user with username, communicates valid or invalid password

observe_auth_client_logon_user/2

Send a request to the client to login a user. The zotonic.auth.worker.js will

observe_auth_client_switch_user/2

Send a request to the client to switch users. The zotonic.auth.worker.js will

observe_auth_confirm/3

Confirm a user id.

observe_auth_confirm_done/2

A user id has been confirmed.

observe_auth_identity_types/3

Return the list of identity types that allow somebody to logon and become an active user of the system. Defaults to […

observe_auth_logoff/3

User is about to log off. Modify (if needed) the logoff request context.

observe_auth_logon/3

User logs on. Add user-related properties to the logon request context.

observe_auth_options_update/3

Update the given (accumulator) authentication options with the request options.

observe_auth_postcheck/2

First for logon of user with username, called after successful password check.

observe_auth_precheck/2

First for logon of user with username, check for ratelimit, blocks etc.

observe_auth_reset/2

First to check for password reset forms, return undefined, ok, or \{error, Reason\}.

observe_auth_validate/2

First to validate a password. Return \{ok, RscId\} or \{error, Reason\}.

observe_auth_validated/2

Authentication against some (external or internal) service was validated

observe_category_hierarchy_save/2

Save (and update) the complete category hierarchy

observe_comment_insert/2

Notification to signal an inserted comment. ‘comment_id’ is the id of the inserted comment, ‘id’ is the id of the…

observe_content_security_header(Default, Acc, Context)

Check and possibly modify the http response security headers All headers are in lowercase.

observe_content_types_dispatch/3

Get available content types and their dispatch rules Example: \{\{<<”text”>>, <<”html”>>, [\]\}, page\} A special…

observe_cors_headers/2

Set CORS headers on the HTTP response.

observe_custom_pivot/2

Add custom pivot fields to a resource’s search index (map) Result is a single tuple or list of tuples `{pivotname

observe_debug/2

Push some information to the debug page in the user-agent. Will be displayed with io_lib:format(“~p: ~p~n”, [What

observe_dispatch/2

Final try for dispatch, try to match the request. Called when the site is known, but no match is found for the path

observe_dispatch_host/2

Try to find the site for the request Called when the request Host doesn’t match any active site.

observe_dispatch_rewrite/3

Rewrite a URL before it will be dispatched using the z_sites_dispatcher

observe_dropbox_file/2

Handle a new file received in the ‘files/dropbox’ folder of a site. Unhandled files are deleted after an hour. If the…

observe_edge_delete/2

An edge has been deleted Note that the Context for this notification does not have the user who deleted the edge.

observe_edge_insert/2

An edge has been inserted. Note that the Context for this notification does not have the user who created the edge.

observe_edge_update/2

An edge has been updated Note that the Context for this notification does not have the user who updated the edge.

observe_email_add_handler/2

Add a handler for receiving e-mail notifications

observe_email_bounced/2

Bounced e-mail notification. The recipient is the e-mail that is bouncing. When the the message_nr is unknown the it is…

observe_email_dkim_options/2

Return the options for the DKIM signature on outgoing emails. Called during email encoding.

observe_email_drop_handler/2

Drop an e-mail handler for a user/resource id. (notify). The notification, user and resource should be the same as when…

observe_email_ensure_handler/2

Add a handler for receiving e-mail notifications

observe_email_failed/2

Notify that we could NOT send an e-mail (there might be a bounce later...) The Context is the depickled z_email:send/2…

observe_email_is_blocked/2

Check if an email address is blocked

observe_email_is_recipient_ok/2

Check if an email address is safe to send email to. The email address is not blocked and is not marked as bouncing.

observe_email_received/2

Notification sent to a site when e-mail for that site is received

observe_email_send_encoded/2

Add a handler for receiving e-mail notifications

observe_email_sent/2

Notify that we could NOT send an e-mail (there might be a bounce later...) The Context is the depickled z_email:send/2…

observe_email_status/2

Email status notification, sent when the validity of an email recipient changes

observe_export_resource_content_disposition/2

mod_export - return the \{ok, Disposition\} for the content disposition.

observe_export_resource_content_type/2

mod_export - Determine the mime type for the export.

observe_export_resource_data/2

mod_export - fetch a row for the export, can return a list of rows, a binary, and optionally a continuation state.

observe_export_resource_encode/2

mod_export - Encode a single data element.

observe_export_resource_filename/2

mod_export - return the \{ok, Filename\} for the content disposition.

observe_export_resource_footer/2

mod_export - Fetch the footer for the export. Should cleanup the continuation state, if needed.

observe_export_resource_header/2

mod_export - Fetch the header for the export.

observe_export_resource_visible/2

mod_export - Check if the resource or dispatch is visible for export.

observe_filewatcher/2

Broadcast some file changed, used for livereload by mod_development

observe_hierarchy_updated/2

Signal that the hierarchy underneath a resource has been changed by mod_menu

observe_http_log_access/2

Access log event for http. Called from the z_stats.

observe_identity_password_match/2

Check if passwords are matching. Uses the password hashing algorithms.

observe_identity_update_done/2

Notify that a user’s identity has been updated by the identity model.

observe_identity_verification/2

Request to send a verification to the user. Return ok or an error. Handled by mod_signup to send out verification…

observe_identity_verified/2

Notify that a user’s identity has been verified. Signals to modules handling identities to mark this identity as…

observe_import_csv_definition/2

Find an import definition for a CSV file by checking the filename of the to be imported file.

observe_import_resource/2

An external feed delivered a resource. First handler can import it. Return:: {ok, m_rsc:resource_id()} , `{error

observe_language/2

Notify that the session’s language has been changed

observe_language_detect/2

Try to detect the language of a translation. Set is_editable_only to false to detect any language, even if the language…

observe_logon_options/3

Check for logon options, called if logon_submit returns undefined. This is used to fetch external (or local…

observe_logon_ready_page/2

Check where to go after a user logs on.

observe_logon_submit/2

Handle a user logon. The posted query args are included. Return:: {ok, UserId} or {error, Reason}

observe_mailinglist_mailing/2

Send a page to a mailinglist (notify) Use \{single_test_address, Email\} when sending to a specific e-mail address.

observe_mailinglist_message/2

Send a welcome or goodbye message to the given recipient. The recipient is either a recipient-id or a recipient props.

observe_m_config_update/2

Site configuration parameter was changed

observe_m_config_update_prop/2

Site configuration parameter was changed

observe_media_identify_extension/2

Try to find a filename extension for a mime type (example: <<".jpg"\>\> )

observe_media_identify_file/2

Try to identify a file, returning a map with file properties.

observe_media_import/2

Notification to translate or map a file after upload, before insertion into the database Used in mod_video to queue…

observe_media_import_medium/2

Notification to import a medium record from external source. This is called for non-file medium records, for example…

observe_media_preview_options/3

Modify the options for an image preview url or tag. This is called for every image url generation, except if the…

observe_media_replace_file/2

Notification that a medium file has been changed (notify) The id is the resource id, medium contains the medium’s…

observe_media_stillimage/2

See if there is a ‘still’ image preview of a media item. (eg posterframe of a movie) Return:: {ok, ResourceId} or…

observe_media_update_done/2

Media update done notification. action is ‘insert’, ‘update’ or ‘delete’

observe_media_upload_preprocess/2

Notification to translate or map a file after upload, before insertion into the database Used in mod_video to queue…

observe_media_upload_props/3

Notification that a medium file has been uploaded. This is the moment to change properties, modify the file etc. The…

observe_media_upload_rsc_props/3

Notification that a medium file has been uploaded. This is the moment to change resource properties, modify the file…

observe_media_viewer/2

Request to generate a HTML media viewer for a resource. The HTML data can not contain any Javascript, as it might be…

observe_media_viewer_consent/2

Optionally wrap HTML with external content so that it adheres to the cookie/privacy settings of the current site…

observe_menu_rsc/2

Fetch the menu id belonging to a certain resource

observe_menu_save/2

Save the menu tree of a menu resource

observe_middleware/3

Delegates the request processing.

observe_module_activate/2

A module has been activated and started.