smtp

package
v0.1.12 Latest Latest
Warning

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

Go to latest
Published: Dec 8, 2024 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ComponentName = "smtp_send_email"
	ResponsePort  = "response"
	ErrorPort     = "error"
	RequestPort   = "request"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Component

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

func (*Component) GetInfo

func (t *Component) GetInfo() module.ComponentInfo

func (*Component) Handle

func (t *Component) Handle(ctx context.Context, responseHandler module.Handler, port string, msg interface{}) error

func (*Component) Instance

func (t *Component) Instance() module.Component

func (*Component) Ports

func (t *Component) Ports() []module.Port

type Context

type Context any

type Error

type Error struct {
	Context   Context `json:"context"`
	Error     string  `json:"error"`
	MessageID string  `json:"messageID"`
}

type Recipient

type Recipient struct {
	Name  string `json:"name" title:"Name" colSpan:"col-span-6"`
	Email string `json:"email" required:"true" title:"Email settings" format:"email" minLength:"1" colSpan:"col-span-6"`
}

type Request

type Request struct {
	Context      Context      `json:"context,omitempty" configurable:"true" title:"Context"`
	SmtpSettings SmtpSettings `json:"smtpSettings" required:"true" title:"SMTP Settings"`

	ContentType string `json:"contentType" required:"true" title:"Content type" enum:"text/plain,text/html,application/octet-stream"`

	From string      `json:"from" title:"From"`
	To   []Recipient `json:"to" required:"true" description:"List of recipients" title:"To" uniqueItems:"true" minItems:"1"`

	Subject string `json:"subject" title:"Subject"`
	Body    string `json:"body" title:"Email body" format:"textarea"`
}

type Response

type Response struct {
	Context   Context `json:"context"`
	MessageID string  `json:"messageID"`
}

type Settings

type Settings struct {
	EnableErrorPort    bool `` /* 150-byte string literal not displayed */
	EnableResponsePort bool `json:"enableResponsePort" required:"true" title:"Enable Response port"`
}

type SmtpSettings

type SmtpSettings struct {
	Host     string `json:"host" required:"true" minLength:"1" title:"SMTP Host"`
	Port     int    `json:"port" required:"true" title:"SMTP Port"`
	Username string `json:"username" title:"SMTP username" required:"true"`
	Password string `json:"password" title:"SMTP password" required:"true"`
	Test     bool   `json:"test" format:"button" title:"Test connection" required:"true"`
}

Jump to

Keyboard shortcuts

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