cmd

package
v0.0.0-...-b62e50d Latest Latest
Warning

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

Go to latest
Published: Apr 19, 2022 License: GPL-3.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Execute

func Execute()

Types

type EmailSendOutcome

type EmailSendOutcome struct {
	Error error
}

type EmailSendRequest

type EmailSendRequest struct {
	IPAddress     string
	FirstName     string
	LastName      string
	ProductSerial string
	ProductModel  string
	PhoneNumber   string
	CompanyName   string
	EmailAddress  string
	Description   string
	Result        chan<- EmailSendOutcome
}
type Header struct {
	From string `yaml:"From"`
	//To            string `yaml:"To"`
	Subject       string `yaml:"Subject"`
	MIME          string `yaml:"MIME"`
	Miscellaneous string `yaml:"Miscellaneous"`
}

Header is the email header.

func (*Header) ToString

func (h *Header) ToString(to string) string

type MailConfig

type MailConfig struct {
	Sender       SenderConfig         `yaml:"Sender"`
	Recipients   map[string]Recipient `yaml:"Recipients"`
	Header       Header               `yaml:"Header"`
	TemplateText string               `yaml:"TemplateText"`
	// contains filtered or unexported fields
}

Config unites all following configs into a single type

func (*MailConfig) EmailerInstance

func (m *MailConfig) EmailerInstance(ch <-chan EmailSendRequest)

type Recipient

type Recipient struct {
	Name          string      `yaml:"Name"`
	Title         string      `yaml:"Title"`
	Address       string      `yaml:"Address"`
	Miscellaneous interface{} `yaml:"Miscellaneous"`
}

Recipient is a person who receives an email. Parameters here are used in email template. the email is sent to `Address`

type SenderConfig

type SenderConfig struct {
	Host     string `yaml:"ServerHost"`
	Port     int    `yaml:"ServerPort"`
	Address  string `yaml:"SenderAddress"`
	Name     string `yaml:"SenderName"`
	Password string `yaml:"SenderPassword"`
}

SenderConfig describes from who and which host we should send the emails

type ServerConfig

type ServerConfig struct {
	Address string `yaml:"Address"`
	BaseURL string `yaml:"BaseURL"`

	EmailConfig MailConfig `yaml:"EmailConfig"`
}

Jump to

Keyboard shortcuts

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