CoolCMS API

ResponseMarkReadTrait

Page behind the "mark as read" button of the new-response e-mail.

A guest opens it, so there is deliberately no requireLoggedUser() (the page has logged = 0 in the DB). The response is marked as read immediately on open (GET), without a confirmation button. A client that CrawlerDetector recognizes as a robot (link previews, crawlers) writes nothing.

IMPORTANT: the page shows no data of the response or the profile, only a message. The front end does not verify the key: id and key from the URL go unchanged to the Api, which alone decides (ResponseMarkReadTrait). An invalid key, a missing key and a nonexistent/deleted response give the same message and HTTP 200.

NOTE: mail clients and security scanners sometimes open e-mail links themselves (without a robot User-Agent) and the response is then marked as read without a human; this is accepted, the only damage is the flipped read flag.

Table of Contents

Methods

actionMarkRead()  : void
renderMarkRead()  : void
resolveMarkReadState()  : "read"|"invalid"|"crawler"

Methods

actionMarkRead()

public actionMarkRead(string|int|null $slug[, string $id = '' ][, string $key = '' ]) : void
Parameters
$slug : string|int|null
$id : string = ''
$key : string = ''

renderMarkRead()

public renderMarkRead(string|int|null $slug[, string $id = '' ][, string $key = '' ]) : void
Parameters
$slug : string|int|null
$id : string = ''
$key : string = ''

resolveMarkReadState()

private resolveMarkReadState(string $id, string $key) : "read"|"invalid"|"crawler"
Parameters
$id : string
$key : string
Return values
"read"|"invalid"|"crawler"
On this page

Search results