feat: extract email metadata from file-type messages #192
+214
−1
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
FilesToText()to extract email metadata (From, CC, Subject) fromfiles[]whenmsg.Textis emptyfiles[]withfiletype: "email", resulting in completely empty text output — this PR fills that gapRef #191 (partial fix — metadata only; email body requires upstream dependency update)
Before / After
Slack API response (forwarded email)
{ "text": "", "files": [{ "filetype": "email", "subject": "Meeting Tomorrow", "from": [{"name": "John Doe", "address": "[email protected]"}], "cc": [{"address": "[email protected]"}] }] }conversations_history CSV output
Before:
After:
Design decisions
filterSpecialChars(,instead of;,atinstead of@,/between CC recipients)To/BCComitted —Tocontains Slack internal routing addresses (e.g.Email <>);BCCis not included in the Slack API responseslack-go/slackFilestruct does not yet map theplain_textfield; this will be possible after feat: add PlainText and PreviewPlainText fields to File struct slack-go/slack#1522 is released (see feat: extract email metadata from file-type messages #191 for details)conversations_searchnot covered — Slack'sSearchMessagetype has noFilesfield; onlyconversations_historyandconversations_repliesare supportedConflict with #190
This PR conflicts with #190 (Block Kit text extraction) at
conversations.goL702, since both modify the same fallback logic. The resolution is to chain the fallbacks:Whichever PR merges first, the other can be rebased with this 3-line addition.
Test plan
FilesToText(filtering, all field combinations, edge cases)ProcessText/filterSpecialChars