mailing

package
v0.0.0-...-8717a1f Latest Latest
Warning

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

Go to latest
Published: Jan 1, 2020 License: GPL-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	MetricKeys = []string{"method"}
)

Functions

func EmailVerificationTemplate

func EmailVerificationTemplate(args map[string]interface{}) (string, error)

func OTPTemplate

func OTPTemplate(args map[string]interface{}) (string, error)

Types

type MailAddress

type MailAddress struct {
	Name    string `json:"name"`
	Address string `json:"address"`
}

type SendEmailOption

type SendEmailOption struct {
	From         MailAddress            `json:"from"`
	To           []MailAddress          `json:"to"`
	Subject      string                 `json:"subject"`
	Template     string                 `json:"template"`
	TemplateArgs map[string]interface{} `json:"args"`
}

type Service

type Service interface {
	SendOTPEmail(recipient MailAddress, otpType string, otp string) error
	SendVerificationEmail(recipient MailAddress, verificationLink string) error
}

func NewInstrumentorService

func NewInstrumentorService(latency metrics.Histogram, s Service) Service

func NewService

func NewService(queueName, emailSender string, enqueuer *work.Enqueuer) Service

type TemplateGenerator

type TemplateGenerator func(args map[string]interface{}) (string, error)

type Worker

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

func NewWorker

func NewWorker(mailjetClient *mailjet.Client) *Worker

func (Worker) EnquiryJob

func (w Worker) EnquiryJob(job *work.Job) error

Jump to

Keyboard shortcuts

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