Skip to content

Commit

Permalink
add phone number to payload
Browse files Browse the repository at this point in the history
  • Loading branch information
taylorshephard committed Oct 3, 2023
1 parent 99a1d24 commit 4da5e00
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
3 changes: 2 additions & 1 deletion signup_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -747,8 +747,9 @@ func TestSnapMail(t *testing.T) {
Email: "[email protected]",
SessionID: "tMisBjpLQt8H3oD8B",
StartDateTime: mustMakeTime(t, time.RFC3339, "2023-09-23T18:00:00.000Z"),
Cell: "555-555-5555",
}
wantJSON := `{"eventType":"SESSION_SIGNUP","payload":{"email":"[email protected]","nameFirst":"Abigail","nameLast":"Test","sessionId":"tMisBjpLQt8H3oD8B","startDateTime":"2023-09-23T18:00:00Z"}}`
wantJSON := `{"eventType":"SESSION_SIGNUP","payload":{"email":"[email protected]","nameFirst":"Abigail","nameLast":"Test","sessionId":"tMisBjpLQt8H3oD8B","startDateTime":"2023-09-23T18:00:00Z","phone":"555-555-5555"}}`

mockSnapServer := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
assertEqual(t, r.URL.Path, "/events")
Expand Down
2 changes: 2 additions & 0 deletions snapmail.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ type Payload struct {
NameLast string `json:"nameLast"`
SessionID string `json:"sessionId"`
StartDateTime time.Time `json:"startDateTime,omitempty"`
Phone string `json:"phone"`
}

type signupEvent struct {
Expand Down Expand Up @@ -65,6 +66,7 @@ func (sm *SnapMail) run(ctx context.Context, signup Signup) error {
NameLast: signup.NameLast,
SessionID: signup.SessionID,
StartDateTime: signup.StartDateTime,
Phone: signup.Cell,
},
}

Expand Down

0 comments on commit 4da5e00

Please sign in to comment.