emailx

package module
v0.0.0-...-56a1f5a Latest Latest
Warning

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

Go to latest
Published: Feb 16, 2026 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func SendTemplateEmail

func SendTemplateEmail(payload []byte, tmplFileName, subject, from string, to []string) error

Types

type IEmailClient

type IEmailClient interface {
	Send(content, subject, from string, to []string) error
}

func New

func New() (IEmailClient, error)

func NewFromEnv

func NewFromEnv() (IEmailClient, error)

type PostmarkBaseEvent

type PostmarkBaseEvent struct {
	RecordType PostmarkWebhookType `json:"RecordType"`
	MessageID  string              `json:"MessageID"`
	Tag        string              `json:"Tag,omitempty"`
}

Helper struct for unmarshaling to check type

type PostmarkBounceEvent

type PostmarkBounceEvent struct {
	PostmarkBaseEvent
	ID            int64     `json:"ID"`
	Type          string    `json:"Type"`
	TypeCode      int       `json:"TypeCode"`
	Name          string    `json:"Name"`
	Description   string    `json:"Description"`
	Details       string    `json:"Details"`
	Email         string    `json:"Email"`
	From          string    `json:"From"`
	BouncedAt     time.Time `json:"BouncedAt"`
	DumpAvailable bool      `json:"DumpAvailable"`
	Inactive      bool      `json:"Inactive"`
	CanActivate   bool      `json:"CanActivate"`
	Subject       string    `json:"Subject"`
}

PostmarkBounceEvent represents a bounce webhook

type PostmarkSpamComplaintEvent

type PostmarkSpamComplaintEvent struct {
	PostmarkBaseEvent
	ID            int64     `json:"ID"`
	Type          string    `json:"Type"`
	TypeCode      int       `json:"TypeCode"`
	Name          string    `json:"Name"`
	Tag           string    `json:"Tag"`
	MessageID     string    `json:"MessageID"`
	Email         string    `json:"Email"`
	From          string    `json:"From"`
	Description   string    `json:"Description"`
	Details       string    `json:"Details"`
	BouncedAt     time.Time `json:"BouncedAt"`
	DumpAvailable bool      `json:"DumpAvailable"`
	Inactive      bool      `json:"Inactive"`
	CanActivate   bool      `json:"CanActivate"`
	Subject       string    `json:"Subject"`
}

PostmarkSpamComplaintEvent represents a spam complaint webhook

type PostmarkWebhookType

type PostmarkWebhookType string

PostmarkWebhookType represents the type of webhook event

const (
	PostmarkTypeBounce             PostmarkWebhookType = "Bounce"
	PostmarkTypeSpamComplaint      PostmarkWebhookType = "SpamComplaint"
	PostmarkTypeSubscriptionChange PostmarkWebhookType = "SubscriptionChange"
)

Jump to

Keyboard shortcuts

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