mail

package
v0.0.0-...-a35bd06 Latest Latest
Warning

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

Go to latest
Published: Oct 16, 2019 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const ContactTemplate = emailTemplate("contact-template")

ContactTemplate is the ID for contact email template

View Source
const ForgotPasswordTemplate = emailTemplate("forgot-password-template")

ForgotPasswordTemplate is the ID for email template

View Source
const NeedResponseTemplate = emailTemplate("need-response-template")

NeedResponseTemplate sis the ID for need response template

Variables

This section is empty.

Functions

This section is empty.

Types

type EmailParams

type EmailParams struct {
	To        string
	CC        string
	Subject   string
	Template  emailTemplate
	Variables map[string]string
}

EmailParams struct with emails infos

type Mailer

type Mailer interface {
	SendEmail(EmailParams) error
}

Mailer is a implementation to send emails

func Connect

func Connect() (Mailer, error)

Connect - Create and return a dialer

func SMTPConnect

func SMTPConnect() (Mailer, error)

SMTPConnect - Create and return a dialer

func SendgridConnect

func SendgridConnect() (Mailer, error)

SendgridConnect - Create and return a mailer

type SMTPMailer

type SMTPMailer struct {
	Dial *gomail.SendCloser
}

SMTPMailer is a implementation of SMTP

func (SMTPMailer) SendEmail

func (mailer SMTPMailer) SendEmail(params EmailParams) error

SendEmail - Send email with SMTPMailer

type SendGridMailer

type SendGridMailer struct {
	Client *sendgrid.Client
	// contains filtered or unexported fields
}

SendGridMailer is a implementation of SendGrid API

func (SendGridMailer) SendEmail

func (mailer SendGridMailer) SendEmail(params EmailParams) error

SendEmail - Send email with SendGridMailer

Jump to

Keyboard shortcuts

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