email

package
v1.46.8 Latest Latest
Warning

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

Go to latest
Published: Jul 2, 2026 License: MIT Imports: 1 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

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