feat(cabana): mail preview and test send to yourself
Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -186,6 +186,8 @@ On a customized template, file layout or partial, **Reset to file version** retu
|
||||
|
||||
When a plugin update changes a file you customized, your version is still sent, but the list marks the row Customized and File changed, the status filter's File changed choice finds it, and the form shows a notice. The File version tab shows the lines your version changed against the current file (lines starting with + are only in your version, lines starting with − only in the file) and the file itself. Saving your version again marks the change as reviewed; resetting takes the new file.
|
||||
|
||||
Each mail form has a live preview (`POST /mail/preview`) that renders the unsaved draft through `postcard.Editor` with the template's sample values (or sample content for layouts, partials and branding). **Send test to me** (`POST /mail/test-send`) delivers that draft only to the signed-in administrator's own email: the body never carries a recipient, personal API tokens are refused, and each administrator may send at most five tests per ten minutes (429 with `Retry-After` when the limit is hit).
|
||||
|
||||
## Drivers
|
||||
|
||||
`mail.driver` selects the driver:
|
||||
|
||||
@@ -52,7 +52,7 @@ url: redis://10.0.0.7:6379/0
|
||||
|
||||
Keep a URL that carries a password in the environment instead: `SUMMER_REDIS__URL=redis://:secret@10.0.0.7:6379/0`. `rediss://` connects over TLS and `unix://` through a socket.
|
||||
|
||||
When `serve` starts, it calls `cooler.Install`, which builds the Redis client and pings it, and publishes a `cooler.RateLimitStore` as the `surf.Store` before the router is built. Routes do not change: `throttle:60,1` and `throttle:<bucket>` count in Redis, with the same fixed-window rules as the memory store. Each attempt is one atomic Lua script, so two instances answering requests from the same client count one window together: with `throttle:2,1`, the third request in the minute gets a 429 whichever instance answers it.
|
||||
When `serve` starts, it calls `cooler.Install`, which builds the Redis client and pings it, and publishes a `cooler.RateLimitStore` as the `surf.Store` and as `cooler.Attempter` before the router is built. Routes do not change: `throttle:60,1` and `throttle:<bucket>` count in Redis, with the same fixed-window rules as the memory store. Each attempt is one atomic Lua script, so two instances answering requests from the same client count one window together: with `throttle:2,1`, the third request in the minute gets a 429 whichever instance answers it. Handlers outside `throttle` (for example the admin mail test-send limit) look up the same `cooler.Attempter` so they share the Redis counters when configured.
|
||||
|
||||
Keys are `<prefix>rl:<key>`. The prefix is `cache.prefix`, or by default `app.name` lower-cased with other characters than letters and digits replaced by `_`, followed by `:`, so several applications can share one Redis.
|
||||
|
||||
|
||||
Reference in New Issue
Block a user