email

package
v1.0.5 Latest Latest
Warning

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

Go to latest
Published: Mar 26, 2026 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FormatEmailReport

func FormatEmailReport(articles []store.ArticleWithAnalysis, trends *ai.TrendReport, window, unsubscribeToken, siteURL string) string

FormatEmailReport builds an HTML email body from analyzed articles and trends.

func GenerateToken

func GenerateToken() (string, error)

GenerateToken generates a random unsubscribe token.

Types

type Client

type Client struct {
	// contains filtered or unexported fields
}

Client sends HTML emails via SMTP.

func New

func New(host string, port int, username, password, from, siteURL string) *Client

New creates an email client. Returns nil if host or from is empty.

func (*Client) SendHTML

func (c *Client) SendHTML(to, subject, htmlBody string) error

SendHTML sends an HTML email to a single recipient.

func (*Client) SendWelcome added in v1.0.3

func (c *Client) SendWelcome(to, token string) error

SendWelcome sends a welcome / subscription-confirmation email.

Jump to

Keyboard shortcuts

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