mailing

package
v0.10.1 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Init

func Init(conf config.MailNotificationConf)

Init initializes the mailing

func SendEMail

func SendEMail(mail *email.Email) error

SendEMail send the passed email.Email

Types

type Attachment

type Attachment struct {
	Reader      io.Reader
	Filename    string
	ContentType string
}

Attachment is a type holding information about an email attachment

func (Attachment) MarshalJSON

func (a Attachment) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaler interface

func (*Attachment) UnmarshalJSON

func (a *Attachment) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaler

type MailSender

type MailSender interface {
	Send(to, subject, text string, attachments ...Attachment) error
}

MailSender is an interface for types that can send mails

var ICSMailSender MailSender = icsMailSender{}

ICSMailSender is a MailSender that sends calendar invitations

type TemplateMailSender

type TemplateMailSender interface {
	SendTemplate(to, subject, template string, binding any) error
	MailSender
}

TemplateMailSender is an interface for types that can send template mails

var HTMLMailSender TemplateMailSender = htmlMailSender{}

HTMLMailSender is a MailSender that sends html mails

var PlainTextMailSender TemplateMailSender = plainTextMailSender{}

PlainTextMailSender is a MailSender that sends plain text mails

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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