Skip to content

Commit

Permalink
Send message attribute to Zendesk on attachment submissions
Browse files Browse the repository at this point in the history
  • Loading branch information
Robi9 committed Jan 30, 2023
1 parent 2ff94fe commit 1726447
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions services/tickets/zendesk/service.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import (
"fmt"
"net/http"
"net/url"
"path"
"reflect"
"strings"

Expand Down Expand Up @@ -151,6 +152,14 @@ func (s *service) Forward(ticket *models.Ticket, msgUUID flows.MsgUUID, text str
return errors.Wrap(err, "error converting attachments")
}

if text == "" && len(fileURLs) > 0 {
parsedURL, err := url.Parse(fileURLs[0])
if err != nil {
return err
}
text = path.Base(parsedURL.Path)
}

msg := &ExternalResource{
ExternalID: string(msgUUID),
Message: text,
Expand Down

0 comments on commit 1726447

Please sign in to comment.