Skip to content

Commit cf72f49

Browse files
committed
queue send history on web open ticket
1 parent c1b14f8 commit cf72f49

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

web/ticket/open.go

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ import (
1111
"github.com/nyaruka/goflow/flows"
1212
"github.com/nyaruka/goflow/utils"
1313
"github.com/nyaruka/mailroom/core/models"
14+
"github.com/nyaruka/mailroom/core/tasks/tickets"
1415
"github.com/nyaruka/mailroom/runtime"
1516
"github.com/nyaruka/mailroom/web"
1617
"github.com/pkg/errors"
@@ -111,6 +112,15 @@ func handleOpen(ctx context.Context, rt *runtime.Runtime, r *http.Request, l *mo
111112
if err != nil {
112113
return nil, 500, errors.Wrap(err, "error committing transaction")
113114
}
115+
116+
rc := rt.RP.Get()
117+
defer rc.Close()
118+
119+
err = tickets.QueueSendHistory(rc, newTicket, request.ContactID)
120+
if err != nil {
121+
return nil, 500, errors.Wrap(err, "error queuing send history")
122+
}
123+
114124
return openedTicket, 200, nil
115125
}
116126

0 commit comments

Comments
 (0)