services

package
v4.0.0+incompatible Latest Latest
Warning

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

Go to latest
Published: May 17, 2019 License: MIT Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func LoginAuth

func LoginAuth(username, password string) smtp.Auth

LoginAuth ...

Types

type AmazonMailStrategy

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

AmazonMailStrategy implements MailService interface

func (*AmazonMailStrategy) MIMEForEmailTitle

func (s *AmazonMailStrategy) MIMEForEmailTitle(charSet, title string) string

func (*AmazonMailStrategy) Send

func (s *AmazonMailStrategy) Send(to, subject, body string) error

Send is a pointer receiver function of AmazonMailStrategy, which uses SES to send the mail

type MailService

type MailService interface {
	Send(to, subject, body string) error
}

MailService defines an interface to be implemented

func NewAmazonMailService

func NewAmazonMailService() MailService

NewAmazonMailService returns a AamzonMailStrategy struct with required config

func NewSMTPMailService

func NewSMTPMailService() MailService

NewSMTPMailService returns a SMTPMailStrategy struct with required config

type SMTPMailStrategy

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

SMTPMailStrategy implements EmailStrategy interface

func (*SMTPMailStrategy) Send

func (s *SMTPMailStrategy) Send(to, subject, body string) error

Send is a pointer receiver function of SMTPMailStrategy, which uses smtp servers to send the mail

Jump to

Keyboard shortcuts

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