diff --git a/email.go b/email.go index 0d178e1..bda6515 100644 --- a/email.go +++ b/email.go @@ -5,6 +5,23 @@ import ( "time" ) +// TrackLinksOption are possible options for TrackLinks +type TrackLinksOption string + +const ( + // NoneTrackLinks means no tracking for any links in html or text bodies. + NoneTrackLinks = TrackLinksOption("None") + + // HTMLAndTextTrackLinks means tracking for any links in html and text bodies. + HTMLAndTextTrackLinks = TrackLinksOption("HtmlAndText") + + // HTMLOnlyTrackLinks means tracking for any links only in html bodies. + HTMLOnlyTrackLinks = TrackLinksOption("HtmlOnly") + + // TextOnlyrackLinks means tracking for only links only in text bodies. + TextOnlyrackLinks = TrackLinksOption("TextOnly") +) + // Email is exactly what it sounds like type Email struct { // From: REQUIRED The sender email address. Must have a registered and confirmed Sender Signature. @@ -27,6 +44,11 @@ type Email struct { ReplyTo string `json:",omitempty"` // Headers: List of custom headers to include. Headers []Header `json:",omitempty"` + + // TrackLinks: Activate link tracking for links in the HTML or Text bodies of this email. + // Possible options: None HtmlAndText HtmlOnly TextOnly + TrackLinks TrackLinksOption `json:",omitempty"` + // TrackOpens: Activate open tracking for this email. TrackOpens bool `json:",omitempty"` // Attachments: List of attachments diff --git a/email_test.go b/email_test.go index a6eef60..d935727 100644 --- a/email_test.go +++ b/email_test.go @@ -24,6 +24,7 @@ var testEmail = Email{ }, }, TrackOpens: true, + TrackLinks: HTMLAndTextTrackLinks, Attachments: []Attachment{ { Name: "readme.txt",