mailgo

package module
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: May 18, 2023 License: MIT Imports: 5 Imported by: 0

README

mailgo

Wrapper around go-mail to easily create and configure a mail client to send emails from html templates.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client struct {
	// contains filtered or unexported fields
}

func NewClient

func NewClient(c DialerConfig) (*Client, error)

func (Client) SendMail added in v0.2.0

func (m Client) SendMail(p SendMailParams) error

type DialerConfig

type DialerConfig struct {
	Host      string
	Port      int
	Username  string
	Password  string
	Templates *template.Template
}

type SendMailParams added in v0.2.0

type SendMailParams struct {
	To      []string
	From    string
	Subject string

	// Add plain text part to the email, will be used as fallback if html is also included.
	PlainText string

	// Add html part to the email as a string, (User template params if you want to use templates passed to the client).
	HTML string

	// Template params to execute templates passed to the client.
	TemaplateParams *SendMailTemplateParams
}

type SendMailTemplateParams added in v0.2.0

type SendMailTemplateParams struct {
	Name string
	Data any
}

Jump to

Keyboard shortcuts

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