Documentation
¶
Overview ¶
Package notify is what the notify-only channels (email, ntfy, webhooks) share: turning a channel-agnostic actions.Message into plain text and HTML, and the link back to the web. These channels are one-way: no buttons, no editing. The message says what is due and links to the place where it can be fixed; Telegram stays the interactive channel (ADR 0007).
Everything here reads only the generic parts of a message (title, lines, sections, footer, event), so new kinds of reminders need no changes.
Index ¶
- Constants
- func Body(m actions.Message) string
- func HTML(m actions.Message, link, settings string) string
- func Link(publicURL string, m actions.Message) string
- func PublicURL(raw string) string
- func SettingsLink(publicURL string) string
- func SplitTitle(title string) (emoji, text string)
- func Subject(m actions.Message) string
- func Test(dueDate string) actions.Message
- func Text(m actions.Message, link string) string
- type OneWay
Constants ¶
const OpenLabel = "Open in Exhale"
OpenLabel is the text of the link or button that opens the web.
Variables ¶
This section is empty.
Functions ¶
func Body ¶
Body is everything under the title as plain text: lines, sections with their tables, and the footer. Button rows are left out.
func HTML ¶
HTML is the message as a small HTML page for email. link ("" for none) becomes the one button; settings ("" for none) a footer link.
func Link ¶
Link is the web address that shows what the message is about: the subscription of a charge, or the home page for other messages. It is "" when the instance has no public address (--public-url).
func PublicURL ¶
PublicURL cleans the instance's public address ("" if it is not an http or https URL): no trailing slash, no query.
func SettingsLink ¶
SettingsLink is where notifications are managed in the web ("" without a public address).
func SplitTitle ¶
SplitTitle separates the emoji a title starts with from its text: "🔔 Netflix renews in 3 days" → "🔔", "Netflix renews in 3 days".
func Subject ¶
Subject is a one-line summary: the title without its emoji, plus the amount when the message is about a charge ("Netflix renews in 3 days — 12.99 EUR").