Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func HMACSecret ¶
func HMACSecret() string
HMACSecret returns the DIGEST_HMAC_SECRET env var used for unsubscribe tokens.
func RenderDigest ¶
func RenderDigest(events []postgres.NotificationEvent, baseURL, unsubURL string) (htmlBody, textBody string)
RenderDigest produces HTML and plain-text bodies for a weekly digest email. Events are pre-sorted by created_at DESC and capped at the caller's limit. unsubURL is the HMAC-signed one-click unsubscribe URL (may be empty if secret is not configured).
func UnsubscribeToken ¶
UnsubscribeToken generates an HMAC-SHA256 token for one-click unsubscribe.
func ValidateUnsubscribeToken ¶
ValidateUnsubscribeToken checks an unsubscribe token using constant-time comparison.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.