email

package
v0.0.0-...-17871bd Latest Latest
Warning

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

Go to latest
Published: Feb 4, 2024 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

View Source
const (
	TmplCorporationSigning  = "corporation signing"
	TmplIndividualSigning   = "individual signing"
	TmplEmployeeSigning     = "employee signing"
	TmplNotifyingManager    = "notifying manager"
	TmplVerificationCode    = "verificaition code"
	TmplAddingCorpAdmin     = "adding corp admin"
	TmplAddingCorpManager   = "adding corp manager"
	TmplRemovingCorpManager = "removing corp manager"
	TmplActivatingEmployee  = "activating employee"
	TmplInactivaingEmployee = "inactivating employee"
	TmplRemovingingEmployee = "removing employee"
)

Variables

View Source
var EmailAgent = &emailAgent{emailClients: map[string]IEmail{}}

Functions

func Initialize

func Initialize(configFile string) error

Types

type AddingCorpManager

type AddingCorpManager struct {
	Admin            bool
	ID               string
	User             string
	Email            string
	Password         string
	Org              string
	ProjectURL       string
	URLOfCLAPlatform string
}

func (AddingCorpManager) GenEmailMsg

func (this AddingCorpManager) GenEmailMsg() (*EmailMessage, error)

type CorporationSigning

type CorporationSigning struct {
	Org         string
	Date        string
	AdminName   string
	ProjectURL  string
	SigningInfo string
}

func (CorporationSigning) GenEmailMsg

func (this CorporationSigning) GenEmailMsg() (*EmailMessage, error)

type EmailMessage

type EmailMessage struct {
	From       string   `json:"from"`
	To         []string `json:"to"`
	Subject    string   `json:"subject"`
	Content    string   `json:"content"`
	Attachment string   `json:"attachment"`
}

type EmployeeNotification

type EmployeeNotification struct {
	Removing bool
	Active   bool
	Inactive bool

	Name       string
	ProjectURL string
	Manager    string
	Org        string
}

func (EmployeeNotification) GenEmailMsg

func (this EmployeeNotification) GenEmailMsg() (*EmailMessage, error)

type EmployeeSigning

type EmployeeSigning struct {
	Name       string
	Org        string
	ProjectURL string
	Managers   string
}

func (EmployeeSigning) GenEmailMsg

func (this EmployeeSigning) GenEmailMsg() (*EmailMessage, error)

type IEmail

type IEmail interface {
	GetOauth2CodeURL(state string) string
	GetToken(code, scope string) (*oauth2.Token, error)
	GetAuthorizedEmail(token *oauth2.Token) (string, error)
	SendEmail(token *oauth2.Token, msg *EmailMessage) error
	// contains filtered or unexported methods
}

type IEmailMessageBulder

type IEmailMessageBulder interface {
	// msg returned only includes content
	GenEmailMsg() (*EmailMessage, error)
}

type IndividualSigning

type IndividualSigning struct {
	Name string
}

func (IndividualSigning) GenEmailMsg

func (this IndividualSigning) GenEmailMsg() (*EmailMessage, error)

type NotifyingManager

type NotifyingManager struct {
	EmployeeEmail    string
	ProjectURL       string
	URLOfCLAPlatform string
	Org              string
}

func (NotifyingManager) GenEmailMsg

func (this NotifyingManager) GenEmailMsg() (*EmailMessage, error)

type RemovingCorpManager

type RemovingCorpManager struct {
	User       string
	Org        string
	ProjectURL string
}

func (RemovingCorpManager) GenEmailMsg

func (this RemovingCorpManager) GenEmailMsg() (*EmailMessage, error)

type VerificationCode

type VerificationCode struct {
	Email      string
	Org        string
	Code       string
	ProjectURL string
}

func (VerificationCode) GenEmailMsg

func (this VerificationCode) GenEmailMsg() (*EmailMessage, error)

Jump to

Keyboard shortcuts

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