diff --git a/contacts.go b/contacts.go index 1748485..f88ff30 100644 --- a/contacts.go +++ b/contacts.go @@ -183,6 +183,7 @@ type UpdateContactRequest struct { UserID string FirstName string LastName string + Source string Subscribed *bool UserGroup string MailingLists map[string]bool @@ -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 { diff --git a/contacts_test.go b/contacts_test.go index e611e15..c01c370 100644 --- a/contacts_test.go +++ b/contacts_test.go @@ -277,6 +277,7 @@ func TestUpdateContact(t *testing.T) { Email: "bob@example.com", FirstName: "Bob", LastName: "Smith", + Source: "api", Subscribed: boolPtr(false), UserGroup: "vip", }, @@ -286,6 +287,7 @@ func TestUpdateContact(t *testing.T) { "email": "bob@example.com", "firstName": "Bob", "lastName": "Smith", + "source": "api", "subscribed": false, "userGroup": "vip", },