Other notifications¶
action_event_type¶
Render the javascript for a custom action event type. The custom event type must be a tuple, for example: <code>{% wire type={live id=myid} action={...} %}</code> Must return {ok, Javascript, Context}
- Type:
- first
Return:
#action_event_type{}
properties:- event:
tuple
- trigger_id:
string
- trigger:
string
- postback_js:
iolist
- postback_pickled:
string|binary
- action_js:
iolist
- event:
activity¶
An activity in Zotonic. When this is handled as a notification then return a list of patterns matching this activity. These patterns are then used to find interested subscribers.
- Type:
- map
Return:
#activity{}
properties:- version:
pos_integer
- posted_time:
unknown
- actor:
unknown
- verb:
atom
- object:
unknown
- target:
unknown
- version:
activity_send¶
Push a list of activities via a ‘channel’ (eg ‘email’) to a recipient. The activities are a list of #activity{} records.
- Type:
- first
Return:
#activity_send{}
properties:- recipient_id:
unknown
- channel:
unknown
- queue:
unknown
- activities:
list
- recipient_id:
admin_edit_blocks¶
Used in the admin to fetch the possible blocks for display
- Type:
- foldl
Return:
#admin_edit_blocks{}
properties:- id:
unknown
- id:
admin_rscform¶
Used in the admin to process a submitted resource form
- Type:
- first
Return:
#admin_rscform{}
properties:- id:
unknown
- is_a:
unknown
- id:
broadcast¶
Broadcast notification.
- Type:
- first
Return:
#broadcast{}
properties:- unknown:
unknown
- unknown:
unknown
- unknown:
unknown
- unknown:
unknown
- unknown:
unknown
- unknown:
category_hierarchy_save¶
Save (and update) the complete category hierarchy (notify)
- Type:
- first
Return:
#category_hierarchy_save{}
properties:- tree:
unknown
- tree:
comment_insert¶
Notification to signal an inserted comment. ‘comment_id’ is the id of the inserted comment, ‘id’ is the id of the resource commented on.
- Type:
- notify
Return:
#comment_insert{}
properties:- comment_id:
unknown
- id:
unknown
- comment_id:
cookie_options¶
Modify cookie options, used for setting http_only and secure options. (foldl)
- Type:
- first
Return:
#cookie_options{}
properties:- name:
unknown
- value:
unknown
- name:
debug¶
Push some information to the debug page in the user-agent. Will be displayed with io_lib:format(“~p: ~p~n”, [What, Arg]), be careful with escaping information!
- Type:
- first
Return:
#debug{}
properties:- what:
unknown
- unknown:
unknown
- what:
debug_stream¶
Internal message of mod_development. Start a stream with debug information to the user agent. ‘target’ is the id of the HTML element where the information is inserted. ‘what’ is the kind of debug information being streamed to the user-agent.
- Type:
- first
Return:
#debug_stream{}
properties:- target:
unknown
- unknown:
unknown
- target:
dispatch¶
Final try for dispatch, try to match the request. Called when the site is known, but no match is found for the path
- Type:
- first
- Return:
{ok, RscId::integer()}
,{ok, #dispatch_match{}}
,{ok, #dispatch_redirect{}}
orundefined
#dispatch{}
properties:- host:
binary
- path:
binary
- method:
binary
- protocol:
union
- tracer_pid:
union
- host:
dropbox_file¶
Handle a new file received in the ‘files/dropbox’ folder of a site. Unhandled files are deleted after a hour.
- Type:
- first
Return:
#dropbox_file{}
properties:- filename:
unknown
- filename:
hierarchy_updated¶
Signal that the hierarchy underneath a resource has been changed by mod_menu
- Type:
- notify
Return:
#hierarchy_updated{}
properties:- root_id:
binary|integer
- predicate:
atom
- inserted_ids:
list
- deleted_ids:
list
- root_id:
language¶
Notify that the session’s language has been changed
- Type:
- notify
Return:
#language{}
properties:- language:
unknown
- language:
m_config_update¶
Site configuration parameter was changed
- Type:
- notify
- Return:
- return value is ignored
#m_config_update{}
properties:- module:
atom
- key:
term
- value:
term
- module:
m_config_update_prop¶
Site configuration parameter was changed
- Type:
- notify
- Return:
- return value is ignored
#m_config_update_prop{}
properties:- module:
unknown
- key:
unknown
- prop:
unknown
- value:
unknown
- module:
mailinglist_mailing¶
Send a page to a mailinglist (notify) Use {single_test_address, Email} when sending to a specific e-mail address.
- Type:
- first
Return:
#mailinglist_mailing{}
properties:- list_id:
unknown
- page_id:
unknown
- list_id:
mailinglist_message¶
Send a welcome or goodbye message to the given recipient. (notify). The recipient is either an e-mail address or a resource id. ‘what’ is send_welcome, send_confirm, send_goobye or silent.
- Type:
- first
Return:
#mailinglist_message{}
properties:- what:
unknown
- list_id:
unknown
- recipient:
unknown
- what:
module_activate¶
A module has been activated and started. (notify)
- Type:
- first
Return:
#module_activate{}
properties:- module:
atom
- pid:
pid
- module:
module_deactivate¶
A module has been stopped and deactivated. (notify)
- Type:
- first
Return:
#module_deactivate{}
properties:- module:
atom
- module:
mqtt_subscribe¶
Subscribe a function to an MQTT topic. The function will be called from a temporary process, and must be of the form: m:f(#emqtt_msg{}, A, Context)
- Type:
- first
Return:
#mqtt_subscribe{}
properties:- topic:
unknown
- qos:
union
- mfa:
unknown
- topic:
mqtt_unsubscribe¶
Unsubscribe a function from an MQTT topic. The MFA _must_ match the one supplied with #mqtt_subscribe{}
- Type:
- first
Return:
#mqtt_unsubscribe{}
properties:- topic:
unknown
- mfa:
unknown
- topic:
multiupload¶
Handle an uploaded file which is part of a multiple file upload from a user-agent. The upload is a #upload record or a filename on the server.
- Type:
- first
- Return:
#context{}
with the result orundefined
#multiupload{}
properties:- upload:
term|string
- query_args:
list
- upload:
postback_event¶
Message sent by a user-agent on a postback event. Encapsulates the encoded postback and any additional data. This is handled by z_transport.erl, which will call the correct event/2 functions.
- Type:
- first
Return:
#postback_event{}
properties:- postback:
unknown
- trigger:
unknown
- target:
unknown
- triggervalue:
unknown
- data:
unknown
- postback:
postback_notify¶
Handle a javascript notification from the postback handler. The ‘message’ is the z_msg argument of the request. (first), ‘trigger’ the id of the element which triggered the postback, and ‘target’ the id of the element which should receive possible updates. Note: postback_notify is also used as an event.
- Type:
- first
- Return:
undefined
or#context{}
with the result of the postback#postback_notify{}
properties:- message:
unknown
- trigger:
unknown
- target:
unknown
- data:
unknown
- message:
sanitize_element¶
Sanitize an HTML element.
- Type:
- foldl
Return:
#sanitize_element{}
properties:- element:
tuple
- stack:
list
- element:
sanitize_embed_url¶
Sanitize an embed url. The hostpart is of the format: <<”youtube.com/v...”>>.
- Type:
- first
- Return:
undefined
,false
or a binary with a acceptable hostpath#sanitize_embed_url{}
properties:- hostpath:
binary
- hostpath:
scomp_script_render¶
Add extra javascript with the {% script %} tag. (map) Used to let modules inject extra javascript depending on the arguments of the {% script %} tag. Must return an iolist()
- Type:
- first
Return:
#scomp_script_render{}
properties:- is_nostartup:
boolean
- args:
list
- is_nostartup:
search_query¶
Handle custom named search queries in your function.
- Type:
- first
- Return:
#search_sql{}
,#search_result{}
orundefined
#search_query{}
properties:- search:
tuple
- offsetlimit:
tuple
- search:
See also
service_authorize¶
Request API logon
- Type:
- first
Return:
#service_authorize{}
properties:- service_module:
unknown
- service_module:
ssl_options¶
Request the SSL certificates for this site. The server_name property contains the hostname used by the client. (first) Returns either ‘undefined’ or a list of ssl options (type ssl:ssl_option())
- Type:
- first
Return:
#ssl_options{}
properties:- server_name:
binary
- server_name:
tkvstore_delete¶
Delete a value from the typed key/value store
- Type:
- first
Return:
#tkvstore_delete{}
properties:- type:
unknown
- key:
unknown
- type: