mail

package
v0.0.0-...-a99687c Latest Latest
Warning

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

Go to latest
Published: May 16, 2024 License: AGPL-3.0 Imports: 2 Imported by: 11

Documentation

Index

Constants

View Source
const (
	// ModeFromStack is the no-reply mode of a mail, to send mail "to" the
	// user's mail, as a noreply@
	ModeFromStack = "noreply"
	// ModePendingEmail is used to send an email to confirm the new email
	// address of the user
	ModePendingEmail = "pending"
	// ModeFromUser is the "from" mode of a mail, to send mail "from" the user's
	// mail.
	ModeFromUser = "from"
	// ModeSupport is used to send both a request to the support and a
	// confirmation to the user.
	ModeSupport = "support"
	// ModeCampaign is used to send a non transactional email to the user
	ModeCampaign = "campaign"

	// DefaultLayout defines the default MJML layout to use
	DefaultLayout = "layout"
	// CozyCloudLayout defines the alternative MJML layout
	CozyCloudLayout = "layout-cozycloud"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Address

type Address struct {
	Name  string `json:"name"`
	Email string `json:"email"`
}

Address contains the name and mail of a mail recipient.

type Attachment

type Attachment struct {
	Filename string `json:"filename"`
	Content  []byte `json:"content"`
}

Attachment is for attaching a file to the mail

type Options

type Options struct {
	Mode           string                 `json:"mode"`
	Subject        string                 `json:"subject"`
	From           *Address               `json:"from,omitempty"`
	To             []*Address             `json:"to,omitempty"`
	ReplyTo        *Address               `json:"reply_to,omitempty"`
	Dialer         *gomail.DialerOptions  `json:"dialer,omitempty"`
	Date           *time.Time             `json:"date,omitempty"`
	Parts          []*Part                `json:"parts,omitempty"`
	RecipientName  string                 `json:"recipient_name,omitempty"`
	TemplateName   string                 `json:"template_name,omitempty"`
	TemplateValues map[string]interface{} `json:"template_values,omitempty"`
	Attachments    []*Attachment          `json:"attachments,omitempty"`
	Locale         string                 `json:"locale,omitempty"`
	Layout         string                 `json:"layout,omitempty"`
}

Options should be used as the options of a mail with manually defined content: body and body content-type. It is used as the input of the "sendmail" worker.

type Part

type Part struct {
	Type string `json:"type"`
	Body string `json:"body"`
}

Part represent a part of the content of the mail. It has a type specifying the content type of the part, and a body.

Jump to

Keyboard shortcuts

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