Skip to content
Merged
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
4 changes: 4 additions & 0 deletions contacts.go
Original file line number Diff line number Diff line change
Expand Up @@ -183,6 +183,7 @@ type UpdateContactRequest struct {
UserID string
FirstName string
LastName string
Source string
Subscribed *bool
UserGroup string
MailingLists map[string]bool
Expand All @@ -198,6 +199,9 @@ func (c *Client) UpdateContact(req UpdateContactRequest) error {
if req.UserID != "" {
body["userId"] = req.UserID
}
if req.Source != "" {
body["source"] = req.Source
}

b, err := json.Marshal(body)
if err != nil {
Expand Down
2 changes: 2 additions & 0 deletions contacts_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -277,6 +277,7 @@ func TestUpdateContact(t *testing.T) {
Email: "bob@example.com",
FirstName: "Bob",
LastName: "Smith",
Source: "api",
Subscribed: boolPtr(false),
UserGroup: "vip",
},
Expand All @@ -286,6 +287,7 @@ func TestUpdateContact(t *testing.T) {
"email": "bob@example.com",
"firstName": "Bob",
"lastName": "Smith",
"source": "api",
"subscribed": false,
"userGroup": "vip",
},
Expand Down
Loading