{alerts:module_id}

Description

Handles the links of Alerts mails on a public page: confirms a reader's e-mail and unsubscribes a reader from a list. Put it on the page the mails of the list link to (the page of the Alerts module's URL) and pass the long id of the Alerts module; the readers are read from the module's slice of readers. On an ordinary page load it prints nothing, and it prints nothing when the id is no Alerts module. It reads the URL of the request, so its output is never cached.

Confirming: with aw=CODE in the URL (the link of the welcome mail) it marks the reader with that access code as confirmed and prints a box E-mail confirmed (class aa-ok), in the language of the page.

Unsubscribing: with au=CODE and c=LIST in the URL (the unsubscribe link in the body of every mail of the list - _#UNSBFORM in Alerts mails, _#MAILUNSB in the mails of the mailbulk command) it unsubscribes the reader with that access code from the list c and prints a box E-mail unsubscribed (class aa-ok). The list must be a list of the module's slice of readers, else nothing is unsubscribed and nothing printed. The unsubscription holds for the whole list; the confirmation of the address does not change. A page whose URL has au is never stored in the page cache, so every visit unsubscribes.

The header link (since November 2026): mails of the list also carry the header List-Unsubscribe, with the same URL plus one=1 (only when the list's page is an https address). Mail services and link scanners open such links by themselves, so this URL does not unsubscribe on GET: the page shows a short question, Do you want to stop receiving the mails of this list?, with the button Unsubscribe (a form of class aa-unsubscribe posting to the same URL). It unsubscribes on POST with List-Unsubscribe=One-Click - what the button posts, and what Gmail or Yahoo send by RFC 8058 when the reader clicks their own Unsubscribe. The link in the mail body has no one=1 and still unsubscribes on GET.

On a page that reads the reader by fillform (an SSI include) the body link unsubscribes as well, but the header link never does: a GET of it does nothing there (no question either), and a POST does not reach the include.

The code calls the command a start: it is meant to grow into the whole subscription and profile form, today it only confirms and unsubscribes.

Parameters

module_id required default (none)

The long id of the Alerts module. Its list (collection) names the slice of readers, where the readers' items live - that slice is a different id. Required; with an id of no Alerts module 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 unsubscribe link in the body of the mail by AA), that reader is unsubscribed and a green aa-ok notice is shown; the page is not stored in the page cache. Runtime- and install-dependent, so this is illustrative.
virtual{alerts:1a2b3c4d5e6f7a8b9c0d1e2f3a4b5c6d}
Expected(on a URL with au=CODE, c=COLLECTION and one=1 opened by GET: a form of class aa-unsubscribe with the question Do you want to stop receiving the mails of this list? and the button Unsubscribe; after the POST: the green aa-ok box E-mail unsubscribed)
The same expression on the same page, reached by the URL of the List-Unsubscribe header of the mail: au=CODE, c=COLLECTION_ID and one=1. A GET of that URL (a mail scanner, a preview, the reader opening the link) unsubscribes nobody - it shows the question and the button. The reader is unsubscribed by a POST with List-Unsubscribe=One-Click: the button posts it, and Gmail or Yahoo post it by RFC 8058 when the reader clicks Unsubscribe in the mail program. Since November 2026. Runtime- and install-dependent, so this is illustrative.