mail

package
v1.0.9 Latest Latest
Warning

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

Go to latest
Published: Apr 19, 2023 License: MIT Imports: 7 Imported by: 0

Documentation

Overview

Package mail contains a simple mailer that connects to your mail service and sends emails through the jobs channel or direct methods calls. At the moment only supports SMTP.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Mailer

type Mailer struct {

	// Service is the type of mail service to use i.e. SMTP, API
	Service string

	// Templates is the full path to the email templates
	Templates string

	// Jobs is the jobs channel
	Jobs chan Message

	// Results is the results channel for the jobs channel
	Results chan Result
	// contains filtered or unexported fields
}

func NewMailer

func NewMailer(settings MailerSettings, service string, path string) (*Mailer, error)

func (*Mailer) ListenForMail

func (m *Mailer) ListenForMail()

func (*Mailer) Send

func (m *Mailer) Send(msg Message) error

func (*Mailer) SendSMTPMessage

func (m *Mailer) SendSMTPMessage(msg Message) error

type MailerSettings

type MailerSettings struct {
	Domain     string
	Host       string
	Port       int
	Username   string
	Password   string
	AuthMethod string
	Encryption string
	From       string
	FromName   string
}

type Message

type Message struct {
	From        string
	FromName    string
	To          []string
	CC          []string
	BCC         []string
	Subject     string
	Template    string
	Attachments []string
	Data        interface{}
}

type Result

type Result struct {
	Success bool
	Error   error
}

Jump to

Keyboard shortcuts

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