email

package
v0.7.0-rc.1 Latest Latest
Warning

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

Go to latest
Published: Sep 26, 2022 License: MPL-2.0 Imports: 6 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 {
	// contains filtered or unexported fields
}

func NewEmail

func NewEmail(c smtp.SmtpClient) *Email

func (*Email) Build

func (e *Email) Build(glob string, params interface{}) error

TODO(subomi): glob pattern must not match more than one template

func (*Email) Send

func (e *Email) Send(emailAddr, subject string) error

type Message added in v0.6.5

type Message struct {

	// Email represents email recipient.
	Email string `json:"email,omitempty"`

	// Subject of the email
	Subject string `json:"subject,omitempty"`

	// Params to replace the template variables.
	Params interface{} `json:"params,omitempty"`

	// Glob represents which template to use in building the email
	TemplateName TemplateName `json:"template_name,omitempty"`
}

Message represents a generic email message. It can be anything from an organisation invite to a disabled endpoint email

type TemplateName added in v0.6.5

type TemplateName string
const (
	TemplateEndpointUpdate     TemplateName = "endpoint.update"
	TemplateOrganisationInvite TemplateName = "organisation.invite"
	TemplateResetPassword      TemplateName = "reset.password"
	TemplateTwitterSource      TemplateName = "twitter.source"
)

func (TemplateName) String added in v0.6.5

func (t TemplateName) String() string

Jump to

Keyboard shortcuts

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