email

package
v1.33.0 Latest Latest
Warning

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

Go to latest
Published: Feb 23, 2026 License: MIT Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Email

type Email struct {
	Enabled       bool   `json:"enabled"`
	IntegrationId string `json:"integrationId"`

	FromEmail string `json:"fromEmail"`
	FromName  string `json:"fromName"`

	Cc  []string `json:"cc,omitempty"`
	Bcc []string `json:"bcc,omitempty"`

	Subject string `json:"subject"`

	// HTML template to render email from (on our end)
	Template string `json:"template" datastore:",noindex"`

	// ID of remote HTML template (i.e., Mandrill, Sendgrid managed templates)
	TemplateId string `json:"templateId"`

	// HTML / Text body to use (will override any templating directives)
	Html string `json:"html" datastore:",noindex"`
	Text string `json:"text" datastore:",noindex"`
}

Specific email configuration

type Settings

type Settings struct {

	// Default email configuration
	Defaults struct {
		Enabled       bool     `json:"enabled"`
		IntegrationId string   `json:"integrationId"`
		FromName      string   `json:"fromName"`
		FromEmail     string   `json:"fromEmail"`
		Cc            []string `json:"cc,omitempty"`
		Bcc           []string `json:"bcc,omitempty"`
	} `json:"defaults"`

	// Per-email configuration
	Order struct {
		Confirmation Email `json:"confirmation"`
	} `json:"order"`

	User struct {
		Welcome           Email `json:"welcome`
		EmailConfirmation Email `json:"emailConfirmation"`
		EmailConfirmed    Email `json:"emailConfirmed"`
		PasswordReset     Email `json:"passwordReset"`
	} `json:"user"`

	Subscriber struct {
		Welcome Email `json:"welcome`
	} `json:"subscriber"`
}

System-wide email settings

func (Settings) Config

func (s Settings) Config(typ Type) Email

Return email settings updated from defaults

type Type

type Type string

Types of system-defined emails

const (
	OrderConfirmation     Type = "order.confirmation"
	UserWelcome           Type = "user.welcome"
	UserEmailConfirmation Type = "user.emailConfirmation"
	UserEmailConfirmed    Type = "user.emailConfirmed"
	UserPasswordReset     Type = "user.passwordReset"
	SubscriberWelcome     Type = "subscriber.welcome"
)

Jump to

Keyboard shortcuts

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