From be7388a4c1f360e39815723ee33965141f89cf4c Mon Sep 17 00:00:00 2001 From: Vragov Roman Date: Fri, 18 Nov 2022 16:25:50 +0300 Subject: [PATCH 1/2] Add `Utm` field to the `Customer` struct --- v1/client_test.go | 4 ++++ v1/types.go | 9 +++++++++ 2 files changed, 13 insertions(+) diff --git a/v1/client_test.go b/v1/client_test.go index b99a49f..4ef9f79 100644 --- a/v1/client_test.go +++ b/v1/client_test.go @@ -501,6 +501,10 @@ func (t *MGClientTest) Test_TextMessages() { ExternalID: "6", Nickname: "octopus", Firstname: "Joe", + Utm: &Utm{ + Source: "test-source", + Term: "", + }, }, Channel: 1, ExternalChatID: "24798237492374", diff --git a/v1/types.go b/v1/types.go index bc6ea0b..54b21b1 100644 --- a/v1/types.go +++ b/v1/types.go @@ -256,6 +256,15 @@ type Customer struct { Language string `json:"language,omitempty"` Phone string `json:"phone,omitempty"` Email string `json:"email,omitempty"` + Utm *Utm `json:"utm,omitempty"` +} + +type Utm struct { + Source string `json:"source,omitempty"` + Medium string `json:"medium,omitempty"` + Campaign string `json:"campaign,omitempty"` + Term string `json:"term,omitempty"` + Content string `json:"content,omitempty" ` } // Message struct. From 42466db673a8ce8271e105bc88440348645eebc3 Mon Sep 17 00:00:00 2001 From: Neur0toxine Date: Wed, 23 Nov 2022 11:21:43 +0300 Subject: [PATCH 2/2] fix typo in the Utm structure field tag --- v1/types.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/v1/types.go b/v1/types.go index 54b21b1..77491b7 100644 --- a/v1/types.go +++ b/v1/types.go @@ -264,7 +264,7 @@ type Utm struct { Medium string `json:"medium,omitempty"` Campaign string `json:"campaign,omitempty"` Term string `json:"term,omitempty"` - Content string `json:"content,omitempty" ` + Content string `json:"content,omitempty"` } // Message struct.