mailgun

package
v0.0.0-...-9625bed Latest Latest
Warning

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

Go to latest
Published: Jan 4, 2024 License: GPL-3.0 Imports: 11 Imported by: 3

Documentation

Index

Constants

View Source
const EventDelivered = "delivered"
View Source
const EventFailed = "failed"
View Source
const EventRejected = "rejected"
View Source
const EventStored = "stored"

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	ApiKey string
	Domain string
	Eu     bool
}

type DeliveryStatus

type DeliveryStatus struct {
	Tls                 bool   `json:"tls"`
	MxHost              string `json:"mx-host"`
	Code                int    `json:"code"`
	Description         string `json:"description"`
	AttemptNo           int    `json:"attempt-no"`
	Message             string `json:"message"`
	CertificateVerified bool   `json:"certificate-verified"`
}

type Email

type Email struct {
	From       string `json:"From"`
	To         string `json:"To"`
	Subject    string `json:"Subject"`
	Text       string `json:"body-plain"`
	References string `json:"References"`
	MessageId  string `json:"Message-Id"`
	InReplyTo  string `json:"In-Reply-To"`

	Cc  string
	Bcc string
}

type Envelope

type Envelope struct {
	Transport string `json:"transport"`
	Sender    string `json:"sender"`
	SendingIp string `json:"sending-ip"`
	Targets   string `json:"targets"`
}

type EventsResponse

type EventsResponse struct {
	Items  []Item `json:"items"`
	Paging Paging `json:"paging"`
}

type Flags

type Flags struct {
	IsRouted        bool `json:"is-routed"`
	IsAuthenticated bool `json:"is-authenticated"`
	IsSystemTest    bool `json:"is-system-test"`
	IsTestMode      bool `json:"is-test-mode"`
}

type Headers

type Headers struct {
	To        string `json:"to"`
	MessageId string `json:"message-id"`
	From      string `json:"from"`
	Subject   string `json:"subject"`
}

type Item

type Item struct {
	Storage         Storage        `json:"storage"`
	Severity        string         `json:"severity"`
	DeliveryStatus  DeliveryStatus `json:"delivery-status"`
	RecipientDomain string         `json:"recipient-domain"`
	Reason          string         `json:"reason"`
	Flags           Flags          `json:"flags"`
	Timestamp       float64        `json:"timestamp"`
	Envelope        Envelope       `json:"envelope"`
	Message         Message        `json:"message"`
	Recipient       string         `json:"recipient"`
	Event           string         `json:"event"`
}

func (*Item) From

func (i *Item) From() string

func (*Item) To

func (i *Item) To() string

type Mailgun

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

func New

func New() (*Mailgun, error)

func (*Mailgun) CreateAddress

func (m *Mailgun) CreateAddress(user string) string

func (*Mailgun) Forward

func (m *Mailgun) Forward(storageKey string, to string) error

func (*Mailgun) IsInMyDomain

func (m *Mailgun) IsInMyDomain(address string) bool

func (*Mailgun) ListAllEvents

func (m *Mailgun) ListAllEvents(begin, end int64) ([]Item, error)

func (*Mailgun) ListDeliveredEvents

func (m *Mailgun) ListDeliveredEvents(begin, end int64) ([]Item, error)

func (*Mailgun) ListFailedEvents

func (m *Mailgun) ListFailedEvents(begin, end int64) ([]Item, error)

func (*Mailgun) ListRejectedEvents

func (m *Mailgun) ListRejectedEvents(begin, end int64) ([]Item, error)

func (*Mailgun) ListStoredEvents

func (m *Mailgun) ListStoredEvents(begin, end int64) ([]Item, error)

func (*Mailgun) MailerDaemon

func (m *Mailgun) MailerDaemon() string

func (*Mailgun) SendBounceEmail

func (m *Mailgun) SendBounceEmail(email Email, failedRecipient string) error

Sends bounce email. Email.From is ignored.

func (*Mailgun) SendEmail

func (m *Mailgun) SendEmail(email Email) error

type Message

type Message struct {
	Headers Headers `json:"headers"`
	Size    int     `json:"size"`
}

type Paging

type Paging struct {
	Previous string `json:"previous"`
	First    string `json:"first"`
	Last     string `json:"last"`
	Next     string `json:"next"`
}

type Storage

type Storage struct {
	Key string `json:"key"`
}

Jump to

Keyboard shortcuts

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