model

package
v1.30.12 Latest Latest
Warning

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

Go to latest
Published: Oct 8, 2022 License: MIT Imports: 6 Imported by: 4

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func LoggedCloser added in v1.11.0

func LoggedCloser(closer io.Closer)

LoggedCloser closes a ressources with handling error

Types

type Mail

type Mail struct {
	From    string
	Sender  string
	Subject string
	Content io.Reader
	To      []string
}

Mail describe envelope of an email

type MailRequest added in v1.11.0

type MailRequest struct {
	Payload    any
	Tpl        string
	FromEmail  string
	Sender     string
	Subject    string
	Recipients []string
}

MailRequest describes an email to be sent

func NewMailRequest added in v1.11.0

func NewMailRequest() MailRequest

NewMailRequest create a new email

func (MailRequest) As added in v1.11.0

func (mr MailRequest) As(sender string) MailRequest

As set sender

func (MailRequest) Check added in v1.11.0

func (mr MailRequest) Check() error

Check checks if current instance is valid

func (MailRequest) ConvertToMail added in v1.11.0

func (mr MailRequest) ConvertToMail(content io.Reader) Mail

ConvertToMail convert mail request to Mail with given content

func (MailRequest) Data added in v1.11.0

func (mr MailRequest) Data(payload any) MailRequest

Data set payload

func (MailRequest) From added in v1.11.0

func (mr MailRequest) From(fromEmail string) MailRequest

From set from

func (MailRequest) Template added in v1.11.0

func (mr MailRequest) Template(template string) MailRequest

Template set template

func (MailRequest) To added in v1.11.0

func (mr MailRequest) To(recipients ...string) MailRequest

To add recipients to list

func (MailRequest) WithSubject added in v1.11.0

func (mr MailRequest) WithSubject(subject string) MailRequest

WithSubject set subject

Jump to

Keyboard shortcuts

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