Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrQueueEmpty = errors.New("queue is empty")
Functions ¶
This section is empty.
Types ¶
type ConfigProvider ¶
type ConfigProvider interface {
CourierConfig(ctx context.Context) SMTPConfig
}
type Courier ¶
type Courier struct { Dialer *gomail.Dialer GetTemplateType TemplateTyper NewEmailTemplateFromMessage EmailTemplateFromMessage // contains filtered or unexported fields }
func (*Courier) DispatchMessage ¶
func (*Courier) QueueEmail ¶
type EmailTemplate ¶
type EmailTemplate interface { json.Marshaler EmailSubject() (string, error) EmailBody() (string, error) EmailBodyPlaintext() (string, error) EmailRecipient() (string, error) }
func NewEmailTemplateFromMessage ¶
func NewEmailTemplateFromMessage(c SMTPConfig, msg Message) (EmailTemplate, error)
type EmailTemplateFromMessage ¶
type EmailTemplateFromMessage func(c SMTPConfig, msg Message) (EmailTemplate, error)
type Message ¶
type Message struct { ID uuid.UUID `json:"-" faker:"-" db:"id"` NID uuid.UUID `json:"-" faker:"-" db:"nid"` Status MessageStatus `json:"-" db:"status"` Type MessageType `json:"-" db:"type"` Recipient string `json:"-" db:"recipient"` Body string `json:"-" db:"body"` Subject string `json:"-" db:"subject"` TemplateType TemplateType `json:"-" db:"template_type"` TemplateData []byte `json:"-" db:"template_data"` // CreatedAt is a helper struct field for gobuffalo.pop. CreatedAt time.Time `json:"-" faker:"-" db:"created_at"` // UpdatedAt is a helper struct field for gobuffalo.pop. UpdatedAt time.Time `json:"-" faker:"-" db:"updated_at"` }
swagger:ignore
type MessageStatus ¶
type MessageStatus int
const ( MessageStatusQueued MessageStatus = iota + 1 MessageStatusSent MessageStatusProcessing )
type PersistenceProvider ¶
type PersistenceProvider interface {
CourierPersister() Persister
}
type SMTPConfig ¶
type SMTPDependencies ¶
type SMTPDependencies interface { PersistenceProvider x.LoggingProvider ConfigProvider }
type TemplateType ¶
type TemplateType string
const ( TypeRecoveryInvalid TemplateType = "recovery_invalid" TypeRecoveryValid TemplateType = "recovery_valid" TypeVerificationInvalid TemplateType = "verification_invalid" TypeVerificationValid TemplateType = "verification_valid" TypeTestStub TemplateType = "stub" )
func GetTemplateType ¶
func GetTemplateType(t EmailTemplate) (TemplateType, error)
type TemplateTyper ¶
type TemplateTyper func(t EmailTemplate) (TemplateType, error)
Click to show internal directories.
Click to hide internal directories.