forked from keighl/postmark
-
Notifications
You must be signed in to change notification settings - Fork 1
/
sender_signatures.go
41 lines (34 loc) · 1.07 KB
/
sender_signatures.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
38
39
40
41
package postmark
import (
"fmt"
"net/url"
)
// SenderSignature contains the details of the signature of the senders
type SenderSignature struct {
Domain string
EmailAddress string
ReplyToEmailAddress string
Name string
Confirmed bool
ID int64
}
///////////////////////////////////////
///////////////////////////////////////
// SenderSignaturesList is just a list of SenderSignatures as they are in the response
type SenderSignaturesList struct {
TotalCount int
SenderSignatures []SenderSignature
}
// GetSenderSignatures gets a list of sender signatures, limited by count and paged by offset
func (client *Client) GetSenderSignatures(count, offset int64) (SenderSignaturesList, error) {
res := SenderSignaturesList{}
values := &url.Values{}
values.Add("count", fmt.Sprintf("%d", count))
values.Add("offset", fmt.Sprintf("%d", offset))
err := client.doRequest(parameters{
Method: "GET",
Path: fmt.Sprintf("senders?%s", values.Encode()),
TokenType: server_token,
}, &res)
return res, err
}