emailsender

package
v0.0.0-...-4fdfd55 Latest Latest
Warning

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

Go to latest
Published: Sep 1, 2019 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type EmailSender

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

func NewEmailConsumer

func NewEmailConsumer(config *worker.Config, log log.Logger) *EmailSender

func NewEmailSender

func NewEmailSender(config *worker.Config, log log.Logger) (*EmailSender, error)

NewEmailSender returns a new instance of EmailWorker.

func (*EmailSender) ConsumeJobs

func (ew *EmailSender) ConsumeJobs() error

func (*EmailSender) EnqueueMailJob

func (ew *EmailSender) EnqueueMailJob(job *Job) error

func (*EmailSender) Shutdown

func (ew *EmailSender) Shutdown() error

type Job

type Job struct {
	TextTemplate string      `json:"textTemplate"`
	HTMLTemplate string      `json:"htmlTemplate"`
	Subject      string      `json:"subject"`
	Sender       string      `json:"sender"`
	From         string      `json:"from"`
	To           string      `json:"to"`
	Recipient    string      `json:"recipient"`
	Data         interface{} `json:"data"`
}

type MailTemplate

type MailTemplate struct {
	TextTemplate string
	HTMLTemplate string
}

MailTemplate is a set of templates for emails, specifically for the MIME type text/plain and text/html.

func NewMailTemplate

func NewMailTemplate(textPath, htmlPath string) (*MailTemplate, error)

NewEmailTemplate returns a new instance of MailTemplate.

type MailTemplates

type MailTemplates struct {
	PasswordReset *MailTemplate
	UserInvite    *MailTemplate
}

MailTemplates contain all the templates in memory required for enqueuing mail jobs.

func NewMailTemplates

func NewMailTemplates() (*MailTemplates, error)

NewMailTemplates returns a new instance of MailTemplates.

Jump to

Keyboard shortcuts

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