events

package
v4.12.0 Latest Latest
Warning

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

Go to latest
Published: Nov 27, 2023 License: BSD-3-Clause Imports: 2 Imported by: 11

Documentation

Index

Constants

View Source
const (
	EventAccepted              = "accepted"
	EventRejected              = "rejected"
	EventDelivered             = "delivered"
	EventFailed                = "failed"
	EventOpened                = "opened"
	EventClicked               = "clicked"
	EventUnsubscribed          = "unsubscribed"
	EventComplained            = "complained"
	EventStored                = "stored"
	EventDropped               = "dropped"
	EventListMemberUploaded    = "list_member_uploaded"
	EventListMemberUploadError = "list_member_upload_error"
	EventListUploaded          = "list_uploaded"
)
View Source
const (
	TransportHTTP = "http"
	TransportSMTP = "smtp"

	DeviceUnknown       = "unknown"
	DeviceMobileBrowser = "desktop"
	DeviceBrowser       = "mobile"
	DeviceEmail         = "tablet"
	DeviceOther         = "other"

	ClientUnknown       = "unknown"
	ClientMobileBrowser = "mobile browser"
	ClientBrowser       = "browser"
	ClientEmail         = "email client"
	ClientLibrary       = "library"
	ClientRobot         = "robot"
	ClientOther         = "other"

	ReasonUnknown             = "unknown"
	ReasonGeneric             = "generic"
	ReasonBounce              = "bounce"
	ReasonESPBlock            = "espblock"
	ReasonGreylisted          = "greylisted"
	ReasonBlacklisted         = "blacklisted"
	ReasonSuppressBounce      = "suppress-bounce"
	ReasonSuppressComplaint   = "suppress-complaint"
	ReasonSuppressUnsubscribe = "suppress-unsubscribe"
	ReasonOld                 = "old"
	ReasonHardFail            = "hardfail"

	SeverityUnknown   = "unknown"
	SeverityTemporary = "temporary"
	SeverityPermanent = "permanent"
	SeverityInternal  = "internal"

	MethodUnknown = "unknown"
	MethodSMTP    = "smtp"
	MethodHTTP    = "http"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Accepted

type Accepted struct {
	Generic

	Envelope Envelope `json:"envelope"`
	Message  Message  `json:"message"`
	Flags    Flags    `json:"flags"`

	Recipient       string      `json:"recipient"`
	RecipientDomain string      `json:"recipient-domain"`
	Method          string      `json:"method"`
	OriginatingIP   string      `json:"originating-ip"`
	Tags            []string    `json:"tags"`
	Campaigns       []Campaign  `json:"campaigns"`
	UserVariables   interface{} `json:"user-variables"`
	Storage         Storage     `json:"storage"`
}

type Attachment

type Attachment struct {
	FileName    string `json:"filename"`
	ContentType string `json:"content-type"`
	Size        int    `json:"size"`
}

type Campaign

type Campaign struct {
	ID   string `json:"id"`
	Name string `json:"name"`
}

type Clicked

type Clicked struct {
	Generic

	Url string `json:"url"`

	Message     Message     `json:"message"`
	Campaigns   []Campaign  `json:"campaigns"`
	MailingList MailingList `json:"mailing-list"`

	Recipient       string   `json:"recipient"`
	RecipientDomain string   `json:"recipient-domain"`
	Tags            []string `json:"tags"`

	IP          string      `json:"ip"`
	ClientInfo  ClientInfo  `json:"client-info"`
	GeoLocation GeoLocation `json:"geolocation"`

	UserVariables interface{} `json:"user-variables"`
}

type ClientInfo

type ClientInfo struct {
	AcceptLanguage string `json:"accept-language"`
	ClientName     string `json:"client-name"`
	ClientOS       string `json:"client-os"`
	ClientType     string `json:"client-type"`
	DeviceType     string `json:"device-type"`
	IP             string `json:"ip"`
	UserAgent      string `json:"user-agent"`
	Bot            string `json:"bot"`
}

type Complained

type Complained struct {
	Generic

	Message   Message    `json:"message"`
	Campaigns []Campaign `json:"campaigns"`

	Recipient     string      `json:"recipient"`
	Tags          []string    `json:"tags"`
	UserVariables interface{} `json:"user-variables"`
}

type Delivered

type Delivered struct {
	Generic

	Envelope Envelope `json:"envelope"`
	Message  Message  `json:"message"`
	Flags    Flags    `json:"flags"`

	Recipient       string     `json:"recipient"`
	RecipientDomain string     `json:"recipient-domain"`
	Method          string     `json:"method"`
	Tags            []string   `json:"tags"`
	Campaigns       []Campaign `json:"campaigns"`
	Storage         Storage    `json:"storage"`

	DeliveryStatus DeliveryStatus `json:"delivery-status"`
	UserVariables  interface{}    `json:"user-variables"`
}

type DeliveryStatus

type DeliveryStatus struct {
	Code                int     `json:"code"`
	AttemptNo           int     `json:"attempt-no"`
	Description         string  `json:"description,omitempty"`
	Message             string  `json:"message"`
	SessionSeconds      float64 `json:"session-seconds"`
	EnhancedCode        string  `json:"enhanced-code,omitempty"`
	MxHost              string  `json:"mx-host,omitempty"`
	RetrySeconds        int     `json:"retry-seconds,omitempty"`
	CertificateVerified *bool   `json:"certificate-verified,omitempty"`
	TLS                 *bool   `json:"tls,omitempty"`
	Utf8                *bool   `json:"utf8,omitempty"`
}

type Envelope

type Envelope struct {
	MailFrom    string `json:"mail-from"`
	Sender      string `json:"sender"`
	Transport   string `json:"transport"`
	Targets     string `json:"targets"`
	SendingHost string `json:"sending-host"`
	SendingIP   string `json:"sending-ip"`
}

type EventName

type EventName struct {
	Name string `json:"event"`
}

An EventName is a struct with the event name.

func (*EventName) GetName

func (e *EventName) GetName() string

GetName returns the name of the event.

func (*EventName) SetName

func (e *EventName) SetName(name string)

type Failed

type Failed struct {
	Generic

	Envelope Envelope `json:"envelope"`
	Message  Message  `json:"message"`
	Flags    Flags    `json:"flags"`

	Recipient       string     `json:"recipient"`
	RecipientDomain string     `json:"recipient-domain"`
	Method          string     `json:"method"`
	Tags            []string   `json:"tags"`
	Campaigns       []Campaign `json:"campaigns"`
	Storage         Storage    `json:"storage"`

	DeliveryStatus DeliveryStatus `json:"delivery-status"`
	Severity       string         `json:"severity"`
	Reason         string         `json:"reason"`
	UserVariables  interface{}    `json:"user-variables"`
}

type Flags

type Flags struct {
	IsAuthenticated bool `json:"is-authenticated"`
	IsBig           bool `json:"is-big"`
	IsSystemTest    bool `json:"is-system-test"`
	IsTestMode      bool `json:"is-test-mode"`
	IsDelayedBounce bool `json:"is-delayed-bounce"`
}

type Generic

type Generic struct {
	EventName
	Timestamp float64 `json:"timestamp"`
	ID        string  `json:"id"`
}

func (*Generic) GetID

func (g *Generic) GetID() string

func (*Generic) GetTimestamp

func (g *Generic) GetTimestamp() time.Time

func (*Generic) SetID

func (g *Generic) SetID(id string)

func (*Generic) SetTimestamp

func (g *Generic) SetTimestamp(t time.Time)

type GeoLocation

type GeoLocation struct {
	City    string `json:"city"`
	Country string `json:"country"`
	Region  string `json:"region"`
}

type ListMemberUploadError

type ListMemberUploadError struct {
	Generic
	MailingList       MailingList      `json:"mailing-list"`
	TaskID            string           `json:"task-id"`
	Format            string           `json:"format"`
	MemberDescription string           `json:"member-description"`
	Error             MailingListError `json:"error"`
}

type ListMemberUploaded

type ListMemberUploaded struct {
	Generic
	MailingList MailingList       `json:"mailing-list"`
	Member      MailingListMember `json:"member"`
	TaskID      string            `json:"task-id"`
}

type ListUploaded

type ListUploaded struct {
	Generic
	MailingList   MailingList       `json:"mailing-list"`
	IsUpsert      bool              `json:"is-upsert"`
	Format        string            `json:"format"`
	UpsertedCount int               `json:"upserted-count"`
	FailedCount   int               `json:"failed-count"`
	Member        MailingListMember `json:"member"`
	Subscribed    bool              `json:"subscribed"`
	TaskID        string            `json:"task-id"`
}

type MailingList

type MailingList struct {
	Address string `json:"address"`
	ListID  string `json:"list-id"`
	SID     string `json:"sid"`
}

type MailingListError

type MailingListError struct {
	Message string
}

type MailingListMember

type MailingListMember struct {
	Subscribed bool
	Address    string
	Name       string
	Vars       []string
}

type Message

type Message struct {
	Headers     MessageHeaders `json:"headers"`
	Attachments []Attachment   `json:"attachments"`
	Recipients  []string       `json:"recipients"`
	Size        int            `json:"size"`
}

type MessageHeaders

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

type Opened

type Opened struct {
	Generic

	Message     Message     `json:"message"`
	Campaigns   []Campaign  `json:"campaigns"`
	MailingList MailingList `json:"mailing-list"`

	Recipient       string   `json:"recipient"`
	RecipientDomain string   `json:"recipient-domain"`
	Tags            []string `json:"tags"`

	IP          string      `json:"ip"`
	ClientInfo  ClientInfo  `json:"client-info"`
	GeoLocation GeoLocation `json:"geolocation"`

	UserVariables interface{} `json:"user-variables"`
}

type Paging

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

type RawJSON

type RawJSON []byte

func (*RawJSON) UnmarshalJSON

func (v *RawJSON) UnmarshalJSON(data []byte) error

type Rejected

type Rejected struct {
	Generic

	Reject struct {
		Reason      string `json:"reason"`
		Description string `json:"description"`
	} `json:"reject"`

	Message Message `json:"message"`
	Storage Storage `json:"storage"`
	Flags   Flags   `json:"flags"`

	Tags          []string    `json:"tags"`
	Campaigns     []Campaign  `json:"campaigns"`
	UserVariables interface{} `json:"user-variables"`
}

type Response

type Response struct {
	Items  []RawJSON `json:"items"`
	Paging Paging    `json:"paging"`
}

type Storage

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

type Stored

type Stored struct {
	Generic

	Message Message `json:"message"`
	Storage Storage `json:"storage"`
	Flags   Flags   `json:"flags"`

	Tags          []string    `json:"tags"`
	Campaigns     []Campaign  `json:"campaigns"`
	UserVariables interface{} `json:"user-variables"`
}

type Unsubscribed

type Unsubscribed struct {
	Generic

	Message     Message     `json:"message"`
	Campaigns   []Campaign  `json:"campaigns"`
	MailingList MailingList `json:"mailing-list"`

	Recipient       string   `json:"recipient"`
	RecipientDomain string   `json:"recipient-domain"`
	Tags            []string `json:"tags"`

	IP          string      `json:"ip"`
	ClientInfo  ClientInfo  `json:"client-info"`
	GeoLocation GeoLocation `json:"geolocation"`

	UserVariables interface{} `json:"user-variables"`
}

Jump to

Keyboard shortcuts

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