@@ -41,6 +41,9 @@ type Message struct {
41
41
Personalization []Personalization `json:"personalization"`
42
42
Headers []Header `json:"headers"`
43
43
ListUnsubscribe string `json:"list_unsubscribe"`
44
+ PrecedenceBulk bool `json:"precedence_bulk,omitempty"`
45
+ References []string `json:"references,omitempty"`
46
+ Settings Settings `json:"settings,omitempty"`
44
47
}
45
48
46
49
// From - simple struct to declare from name/ email
@@ -87,6 +90,13 @@ type Attachment struct {
87
90
ID string `json:"id,omitempty"`
88
91
}
89
92
93
+ // Settings - you can set email Settings
94
+ type Settings struct {
95
+ TrackClicks bool `json:"track_clicks"`
96
+ TrackOpens bool `json:"track_opens"`
97
+ TrackContent bool `json:"track_content"`
98
+ }
99
+
90
100
// Deprecated: NewMessage - Setup a new message ready to be sent
91
101
func (ms * Mailersend ) NewMessage () * Message {
92
102
return & Message {}
@@ -182,6 +192,26 @@ func (m *Message) SetSendAt(sendAt int64) {
182
192
m .SendAt = sendAt
183
193
}
184
194
195
+ // SetPrecedenceBulk - Set precedence_bulk
196
+ func (m * Message ) SetPrecedenceBulk (precedenceBulk bool ) {
197
+ m .PrecedenceBulk = precedenceBulk
198
+ }
199
+
200
+ // SetReferences - Set references
201
+ func (m * Message ) SetReferences (references []string ) {
202
+ m .References = references
203
+ }
204
+
205
+ // AddReference - Add a reference
206
+ func (m * Message ) AddReference (reference string ) {
207
+ m .References = append (m .References , reference )
208
+ }
209
+
210
+ // SetSettings - Set settings
211
+ func (m * Message ) SetSettings (settings Settings ) {
212
+ m .Settings = settings
213
+ }
214
+
185
215
// Deprecated: Send - send the message
186
216
func (ms * Mailersend ) Send (ctx context.Context , message * Message ) (* Response , error ) {
187
217
req , err := ms .newRequest (http .MethodPost , emailBasePath , message )
0 commit comments