mail

package
v4.1.1 Latest Latest
Warning

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

Go to latest
Published: Dec 27, 2023 License: MIT Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type HTMLMail

type HTMLMail struct {
	ID      string     `json:"id"`
	Sender  *Sender    `json:"sender,omitempty"`
	Subject string     `json:"subject,omitempty"`
	Date    *time.Time `json:"date,omitempty"`
	Body    string     `json:"body,omitempty"`
	IsSPAM  bool       `json:"isSPAM"`
}

HTMLMail is an HTML mail message

func (*HTMLMail) Coloured

func (m *HTMLMail) Coloured() (string, error)

func (*HTMLMail) JSON

func (m *HTMLMail) JSON() (string, error)

func (*HTMLMail) SetID

func (m *HTMLMail) SetID(ID string)

type Identifier

type Identifier interface {
	SetID(string)
}

type Render

type Render interface {
	Coloured() (string, error)
	JSON() (string, error)
}

type RenderIdentifier

type RenderIdentifier interface {
	Identifier
	Render
}

func Parse

func Parse[M client.MailDoc](doc M) (RenderIdentifier, error)

type Sender

type Sender struct {
	Mail string `json:"mail,omitempty"`
	Name string `json:"name,omitempty"`
}

Sender defines a mail sender

type SourceMail

type SourceMail struct {
	ID      string              `json:"id"`
	Headers map[string][]string `json:"headers"`
	Body    string              `json:"body"`
}

SourceMail is an HTML mail message

func (*SourceMail) Coloured

func (m *SourceMail) Coloured() (string, error)

func (*SourceMail) JSON

func (m *SourceMail) JSON() (string, error)

func (*SourceMail) SetID

func (m *SourceMail) SetID(ID string)

Jump to

Keyboard shortcuts

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