notify

package
v0.2.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 11, 2026 License: AGPL-3.0 Imports: 7 Imported by: 0

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

View Source
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

func Body(m actions.Message) string

Body is everything under the title as plain text: lines, sections with their tables, and the footer. Button rows are left out.

func HTML

func HTML(m actions.Message, link, settings string) string

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(publicURL string, m actions.Message) string

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

func PublicURL(raw string) string

PublicURL cleans the instance's public address ("" if it is not an http or https URL): no trailing slash, no query.

func SettingsLink(publicURL string) string

SettingsLink is where notifications are managed in the web ("" without a public address).

func SplitTitle

func SplitTitle(title string) (emoji, text string)

SplitTitle separates the emoji a title starts with from its text: "🔔 Netflix renews in 3 days" → "🔔", "Netflix renews in 3 days".

func Subject

func Subject(m actions.Message) string

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").

func Test

func Test(dueDate string) actions.Message

Test is the message the "Send test" buttons deliver: it looks like a real reminder so templates and clients can be checked with it.

func Text

func Text(m actions.Message, link string) string

Text is the whole message as plain text, ending with the link if any.

Types

type OneWay

type OneWay struct{}

OneWay is embedded by channels that cannot edit what they sent.

func (OneWay) Edit

Edit does nothing: the message already left.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL