email

package
v0.2.5 Latest Latest
Warning

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

Go to latest
Published: Nov 24, 2026 License: GPL-3.0 Imports: 8 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package email renders and sends invoice email messages.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Message

type Message struct {
	To      string
	From    string
	Subject string
	Text    string
	HTML    string
}

Message is the email for one invoice, with plain-text and HTML versions.

func Render

func Render(inv *invoice.Invoice, baseURL, from string) Message

Render builds the email message for inv, linking to the invoice detail under baseURL.

type Sender

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

Sender sends invoice email through Resend.

func NewSender

func NewSender(apiKeyFile string) (*Sender, error)

NewSender reads the Resend API key from apiKeyFile and returns a sender that uses it.

func (*Sender) Send

func (s *Sender) Send(msg Message, id string) (string, error)

Send sends msg as the email for the invoice with stored identifier id and returns the Resend email identifier.

Jump to

Keyboard shortcuts

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