forked from SparkPost/gosparkpost
-
Notifications
You must be signed in to change notification settings - Fork 0
/
unsubscribe.go
37 lines (32 loc) · 1.16 KB
/
unsubscribe.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
package events
import "fmt"
type ListUnsubscribe struct {
EventCommon
CampaignID string `json:"campaign_id"`
CustomerID string `json:"customer_id"`
MessageFrom string `json:"mailfrom"`
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"`
}
// String returns a brief summary of a ListUnsubscribe event
func (l *ListUnsubscribe) String() string {
return fmt.Sprintf("%s U %s %s: [%s]",
l.Timestamp, l.TransmissionID, l.Recipient, l.CampaignID)
}
type LinkUnsubscribe struct {
EventCommon
ListUnsubscribe
UserAgent string `json:"user_agent"`
}
// String returns a brief summary of a ListUnsubscribe event
func (l *LinkUnsubscribe) String() string {
return fmt.Sprintf("%s LU %s %s: [%s]",
l.Timestamp, l.TransmissionID, l.Recipient, l.CampaignID)
}