Repository navigation
feat(emails): send cc, bcc and attachments on a code send #408
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. Weβll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
Silthus
wants to merge
14
commits into
main
Choose a base branch
from
feat/emails-code-fields
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+205
β12
Open
Changes from all commits
Commits
Show all changes
14 commits
Select commit
Hold shift + click to select a range
53dd2f6
feat(emails): send transactional email and read its status
Silthus 78c6e6c
refactor(emails): retry one request path, settle the Close test
Silthus 0ffc1f6
fix(emails): refuse nil emails, keep the context cause, reject trailiβ¦
Silthus 63fb4f3
test(emails): assert the shutdown cause on an interrupted send
Silthus 8e181df
fix(emails): encode request bodies with encoding/json
Silthus 5417c2d
test(emails): close the client in the request timeout test
Silthus 8cef8a9
fix(emails): retry an answer cut off mid-body, whatever its status
Silthus c7d0a9c
fix(emails): keep Retry-After on an answer cut off mid-body
Silthus 1c41327
feat(emails): send cc, bcc and attachments on a code send
Silthus 80ee4a5
fix(emails): address the QA swarm panel on the emails API
Silthus 63ea4c7
Merge remote-tracking branch 'origin/feat/emails-send' into feat/emaiβ¦
Silthus 2e2458c
fix(emails): one attachment type, and the reply an older PostHog sends
Silthus 20f7605
Merge main into feat/emails-code-fields
Silthus 86a101d
Merge remote-tracking branch 'origin/main' into feat/emails-code-fields
Silthus File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| --- | ||
| "posthog-go": minor | ||
| --- | ||
|
|
||
| A `CodeEmail` takes `Cc`, `Bcc` and `Attachments`. `Cc` and `Bcc` are lists of bare addresses, at most 10 each. An `EmailAttachment` is a `Filename` and its `Content` bytes, with an optional `ContentType` and `ContentID` (to show the file inline as `cid:<ContentID>`); the client sends the bytes Base64 encoded. PostHog takes at most 10 attachments and 512 KB in total, and refuses file types that mailbox providers block. An attachment without a `Filename` or `Content` fails with the code `invalid_attachment` before any request, and the error never holds the file's content. Empty lists are left out of the request. A PostHog version that doesn't take one of these fields yet refuses the send with an error that names the field, instead of sending without it. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Low: Bound attachments before encoding
Any nonempty
Contentpasses this check regardless of size, andpreparebuffers the entire Base64-encoded JSON body before HTTP timeouts or server-side rejection can apply. Enforce the documented 10-attachment and 512 KB aggregate limits here before encoding to bound client-side memory use when applications forward user-supplied files; no upload-facing caller is shown in this repository.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the look. Leaving this one to the server, on purpose:
Content, so the client adds one Base64 copy, about a third larger. An app that forwards user uploads bounds them where it reads the upload, before it holds them in memory at all.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the detail. I can't automatically confirm this is safe to dismiss, so I'm leaving the thread open for a maintainer to make the call.