Skip to content

Commit

Permalink
Additional field to the File structure (#1370)
Browse files Browse the repository at this point in the history
Slack has a feature called 'Send emails to Slack' -
https://slack.com/intl/en-gb/help/articles/206819278-Send-emails-to-Slack

When emails are sent to this channel, they become Slack files with
additional fields containing sender and receiver information.

I added two new fields to properly support the unmarshaling of file
metadata.
  • Loading branch information
nlopes authored Feb 1, 2025
2 parents 9c781a4 + 383179b commit 1c78410
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions files.go
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,17 @@ type File struct {
NumStars int `json:"num_stars"`
IsStarred bool `json:"is_starred"`
Shares Share `json:"shares"`

Subject string `json:"subject"`
To []EmailFileUserInfo `json:"to"`
From []EmailFileUserInfo `json:"from"`
Cc []EmailFileUserInfo `json:"cc"`
}

type EmailFileUserInfo struct {
Address string `json:"address"`
Name string `json:"name"`
Original string `json:"original"`
}

type Share struct {
Expand Down

0 comments on commit 1c78410

Please sign in to comment.