email

package
v0.0.0-...-3407765 Latest Latest
Warning

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

Go to latest
Published: Aug 29, 2022 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Content

type Content struct {
	FromUserFriendlyName string
	From                 string
	To                   string
	ToFriendlyName       string
	CC                   []string
	Subject              string
	Body                 string
}

Content : email information

type ISender

type ISender interface {
	// SendEmail : Sends a plain text email to the client
	SendEmail(c *Content) error
	// SendHTMLEmail : Sends an email that is formatted with HTML
	SendHTMLEmail(c *Content) error
}

ISender : Email Sender Generic interface that basically can be implemented for many email providers

Forexample => SendGrid , SES , SNS ...etc

func NewSendGridSender

func NewSendGridSender(apiKey string) ISender

NewSendGridSender : email sender that implements i sender (via send_grid api)

type MockSender

type MockSender struct {
	mock.Mock
}

func NewMockSender

func NewMockSender() *MockSender

func (*MockSender) SendEmail

func (m *MockSender) SendEmail(c *Content) error

SendEmail : Sends a plain text email to the client

func (*MockSender) SendHTMLEmail

func (m *MockSender) SendHTMLEmail(c *Content) error

SendHTMLEmail : Sends an email that is formatted with HTML

type SendGridSender

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

SendGridSender : send grid email sender

func (*SendGridSender) SendEmail

func (s *SendGridSender) SendEmail(c *Content) error

SendEmail : Sends a plain text email to the client

func (*SendGridSender) SendHTMLEmail

func (s *SendGridSender) SendHTMLEmail(c *Content) error

SendHTMLEmail : Sends an email that is formatted with HTML

Jump to

Keyboard shortcuts

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