Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions events/events.go
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,8 @@ func EventForName(eventType string) Event {
return &GenerationFailure{}
case "generation_rejection":
return &GenerationRejection{}
case "initial_open":
return &InitialOpen{}
case "injection":
return &Injection{}
case "list_unsubscribe":
Expand Down
25 changes: 25 additions & 0 deletions events/track.go
Original file line number Diff line number Diff line change
Expand Up @@ -53,3 +53,28 @@ func (o *Open) String() string {
return fmt.Sprintf("%s O %s %s",
o.Timestamp, o.TransmissionID, o.Recipient)
}

type InitialOpen struct {
EventCommon
CampaignID string `json:"campaign_id"`
CustomerID string `json:"customer_id"`
DeliveryMethod string `json:"delv_method"`
GeoIP *GeoIP `json:"geo_ip"`
IPAddress string `json:"ip_address"`
MessageID string `json:"message_id"`
Metadata interface{} `json:"rcpt_meta"`
Tags []string `json:"rcpt_tags"`
Recipient string `json:"rcpt_to"`
RecipientType string `json:"rcpt_type"`
TemplateID string `json:"template_id"`
TemplateVersion string `json:"template_version"`
Timestamp Timestamp `json:"timestamp"`
TransmissionID string `json:"transmission_id"`
UserAgent string `json:"user_agent"`
}

// String returns a brief summary of an Open event
func (o *InitialOpen) String() string {
return fmt.Sprintf("%s O %s %s",
o.Timestamp, o.TransmissionID, o.Recipient)
}