{alerts:module_id}

Description

Renders and processes the email-alerts subscription flow for an Alerts module on a public page. Pass the alerts module id (the same id as the module collection, also the reader slice). On a normal page load it returns an empty string. When the page URL carries an aw query parameter (sent in welcome e-mails), it confirms that subscriber e-mail and returns a localized confirmation notice; when it carries an au parameter (sent in alert e-mails, with c the collection id), it unsubscribes that reader and returns a localized notice. If the module id matches no alerts collection it returns empty. Because it reads live query parameters and module state it is never cached. The wiki notes it is an early implementation: at present it handles confirm and unsubscribe; the full subscribe and profile-management form is not yet emitted.

Parameters

module_id required default (none)

The alerts module id - the id of the Alerts module collection whose subscribers this manages. It is also the reader slice id where subscriber items live. Required; with no match the expression returns empty.

Examples

test[{alerts:00000000000000000000000000000000}]
Expected[]
Actual[]
A module id that matches no alerts collection yields an empty string, so the only visible output here is the two literal brackets. This is what a normal page load returns.
test[{alerts:}]
Expected[]
Actual[]
Called with no module id at all, the expression also returns empty - there is no collection to act on. The module id is required for it to do anything.
virtual{alerts:1a2b3c4d5e6f7a8b9c0d1e2f3a4b5c6d}
Expected(on a URL with aw=CODE: a green aa-ok box reading E-mail potvrzen - Czech for E-mail confirmed)
Place the expression on the page that the welcome e-mail links to. When that page is opened with an aw query parameter (the access code AA put in the welcome mail), the matching subscriber is marked confirmed and a green aa-ok notice is shown. Runtime- and install-dependent, so this is illustrative.
virtual{alerts:1a2b3c4d5e6f7a8b9c0d1e2f3a4b5c6d}
Expected(on a URL with au=CODE and c=COLLECTION: a green aa-ok box reading E-mail odhlasen - Czech for E-mail unsubscribed)
Put the same expression on the page the alert e-mails link to for opting out. When opened with au=CODE and c=COLLECTION_ID (both placed in the alert mail by AA), that reader is unsubscribed and a green aa-ok notice is shown. Runtime- and install-dependent, so this is illustrative.