Skip to content

feat(emails): add Headers and Tags to code sends - #415

Merged
mayteio merged 4 commits into
mainfrom
feat/emails-headers-tags
Dec 2, 2026
Merged

mayteio merged 4 commits into
mainfrom
feat/emails-headers-tags

Conversation

@mayteio

@mayteio mayteio commented Dec 1, 2026 •

Copy link
Copy Markdown
Contributor

💡 Motivation and Context

Changes

SendCodeEmailOptions takes Headers and Tags, each an IReadOnlyDictionary<string, string>. The client sends each as given and leaves a null or empty dictionary out of the body. The server owns names, values and limits, and the XML docs list them with the refusal codes (invalid_header, invalid_tag, sandbox_fields_unsupported, field_not_accepted).

Rejected: an SDK check of the template-send case, because SendTemplateEmailOptions has no such properties, so a template send can't carry them by construction. A test pins that. The spec's "not a mapping" check is also impossible with a typed dictionary.

  • Public API: four lines in PublicAPI.Unshipped.txt.
  • Changeset: PostHog minor, so 2.32.0 if no other minor release lands first.

Read yourself: the two body entries, L912-L920: is an empty dictionary left out?

Merge risk: low

Alignment: matches sdk-specs#191.

Impact: additive optional fields; unset sends are byte-for-byte unchanged.

Verification: unit tests cover the body, empty values and the template type.

  • Live send skipped; see the test section.

Rollback cost: two-way door: revert before release, or deprecate.

Error detection: a server refusal throws EmailException with its code.

Tier: non-critical

💚 How did you test it?

What was proven, and what not

  • ✅ New tests fail without the EmailSender change (1 of 4 red), and pass with it.
  • ✅ dotnet restore --locked-mode, bin/fmt --check, Release build, and the full UnitTests suite on net10.0 and net8.0 pass locally.
  • Live send: skipped by Harley's decision on 2026-12-02; covered by unit tests and the server's merged contract.

The tests check the exact JSON body, as the other code-send tests do.

Known issues

  • The version in the XML docs says 2.32.0. Update it if another minor release lands first.

📝 Checklist

  • All commits are signed (see Commit signing)
  • I reviewed the submitted code.
  • I added tests to verify the changes.
  • I updated the docs if needed.
  • No breaking change or entry added to the changelog.

If releasing new changes

  • Ran pnpm changeset to generate a changeset file

🤖 Agent context

Autonomy: Human-driven (agent-assisted)

Claude Code wrote the change test-first from the sdk-specs contract at the assignee's request. The docs on posthog.com describe these fields from the XML docs here.

@mayteio mayteio self-assigned this Dec 1, 2026
@mayteio

mayteio commented Dec 1, 2026

Copy link
Copy Markdown
Contributor Author

@PostHog review

@posthog

posthog Bot commented Dec 1, 2026

Copy link
Copy Markdown
Contributor

@mayteio PostHog Review is reviewing this pull request.

@posthog posthog Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

PostHog Review · Standard · reviewed 59e85c8: no findings.

@github-actions

github-actions Bot commented Dec 1, 2026 •

Copy link
Copy Markdown
Contributor

posthog-dotnet Compliance Report

Date: 2026-12-02T14:38:36.567411+00:00
Duration: 125148ms

✅ All Tests Passed!

47/47 tests passed


Capture Tests

✅ 30/30 tests passed

View Details
Test Status Duration
Format Validation.Event Has Required Fields ✅ 229ms
Format Validation.Event Has Uuid ✅ 125ms
Format Validation.Event Has Lib Properties ✅ 109ms
Format Validation.Distinct Id Is String ✅ 112ms
Format Validation.Token Is Present ✅ 110ms
Format Validation.Custom Properties Preserved ✅ 115ms
Format Validation.Event Has Timestamp ✅ 113ms
Format Validation.Non Utc Event Timestamp Is Converted To Utc ✅ 117ms
Retry Behavior.Retries On 503 ✅ 8122ms
Retry Behavior.Does Not Retry On 400 ✅ 2115ms
Retry Behavior.Does Not Retry On 401 ✅ 2113ms
Retry Behavior.Respects Retry After Header ✅ 8118ms
Retry Behavior.Implements Backoff ✅ 22134ms
Retry Behavior.Retries On 500 ✅ 6117ms
Retry Behavior.Retries On 502 ✅ 6117ms
Retry Behavior.Retries On 504 ✅ 6117ms
Retry Behavior.Max Retries Respected ✅ 22134ms
Deduplication.Generates Unique Uuids ✅ 113ms
Deduplication.Preserves Uuid On Retry ✅ 6115ms
Deduplication.Preserves Uuid And Timestamp On Retry ✅ 13126ms
Deduplication.Preserves Uuid And Timestamp On Batch Retry ✅ 6120ms
Deduplication.No Duplicate Events In Batch ✅ 114ms
Deduplication.Different Events Have Different Uuids ✅ 109ms
Compression.Sends Gzip When Enabled ✅ 109ms
Batch Format.Uses Proper Batch Structure ✅ 107ms
Batch Format.Flush With No Events Sends Nothing ✅ 105ms
Batch Format.Multiple Events Batched Together ✅ 112ms
Error Handling.Does Not Retry On 403 ✅ 2109ms
Error Handling.Does Not Retry On 413 ✅ 2112ms
Error Handling.Retries On 408 ✅ 6115ms

Feature_Flags Tests

✅ 17/17 tests passed

View Details
Test Status Duration
Request Payload.Request With Person Properties Device Id ✅ 140ms
Request Payload.Flags Request Uses V2 Query Param ✅ 108ms
Request Payload.Flags Request Hits Flags Path Not Decide ✅ 108ms
Request Payload.Flags Request Omits Authorization Header ✅ 108ms
Request Payload.Token In Flags Body Matches Init ✅ 111ms
Request Payload.Groups Round Trip ✅ 111ms
Request Payload.Groups Default To Empty Object ✅ 108ms
Request Payload.Disable Geoip False Propagates As Geoip Disable False ✅ 109ms
Request Payload.Disable Geoip Omitted Defaults To False ✅ 109ms
Request Payload.Flag Keys To Evaluate Contains Only Requested Key ✅ 109ms
Request Lifecycle.No Flags Request On Init Alone ✅ 4ms
Request Lifecycle.No Flags Request On Normal Capture ✅ 107ms
Request Lifecycle.Two Flag Calls Produce Two Remote Requests ✅ 212ms
Request Lifecycle.Mock Response Value Is Returned To Caller ✅ 119ms
Retry Behavior.Retries Flags On 502 ✅ 1113ms
Retry Behavior.Retries Flags On 504 ✅ 1111ms
Side Effect Events.Get Feature Flag Captures Feature Flag Called Event ✅ 210ms

@github-actions

github-actions Bot commented Dec 1, 2026 •

Copy link
Copy Markdown
Contributor

SDK performance: posthog-dotnet

Benchmarks completed. No changes flagged for review.

Flags require at least a 5% change in the median and all six pairs agreeing on direction. This is a noise filter, not proof of a performance change or a CI gate.

View all results
Test Measurement Before PR With PR Change Assessment
Capture and deliver events (32-byte payload, burst) Allocations per operation — — — unavailable; base:​ unsupported; head:​ unsupported; base:​ CLR byte counters do not expose exact object allocation counts; native allocations are not included.​; head:​ CLR byte counters do not expose exact object allocation counts; native allocations are not included.​
Capture and deliver events (4,096-byte payload, burst) Allocations per operation — — — unavailable; base:​ unsupported; head:​ unsupported; base:​ CLR byte counters do not expose exact object allocation counts; native allocations are not included.​; head:​ CLR byte counters do not expose exact object allocation counts; native allocations are not included.​
Capture and deliver events (32-byte payload, steady) Allocations per operation — — — unavailable; base:​ unsupported; head:​ unsupported; base:​ CLR byte counters do not expose exact object allocation counts; native allocations are not included.​; head:​ CLR byte counters do not expose exact object allocation counts; native allocations are not included.​
Capture and deliver events (4,096-byte payload, steady) Allocations per operation — — — unavailable; base:​ unsupported; head:​ unsupported; base:​ CLR byte counters do not expose exact object allocation counts; native allocations are not included.​; head:​ CLR byte counters do not expose exact object allocation counts; native allocations are not included.​
Queue an event (32-byte payload) Allocations per operation — — — unavailable; base:​ unsupported; head:​ unsupported; base:​ CLR byte counters do not expose exact object allocation counts; native allocations are not included.​; head:​ CLR byte counters do not expose exact object allocation counts; native allocations are not included.​
Queue an event (4,096-byte payload) Allocations per operation — — — unavailable; base:​ unsupported; head:​ unsupported; base:​ CLR byte counters do not expose exact object allocation counts; native allocations are not included.​; head:​ CLR byte counters do not expose exact object allocation counts; native allocations are not included.​
Evaluate all 10 flags Allocations per operation — — — unavailable; base:​ unsupported; head:​ unsupported; base:​ CLR byte counters do not expose exact object allocation counts; native allocations are not included.​; head:​ CLR byte counters do not expose exact object allocation counts; native allocations are not included.​
Evaluate all 100 flags Allocations per operation — — — unavailable; base:​ unsupported; head:​ unsupported; base:​ CLR byte counters do not expose exact object allocation counts; native allocations are not included.​; head:​ CLR byte counters do not expose exact object allocation counts; native allocations are not included.​
Evaluate all 1,000 flags Allocations per operation — — — unavailable; base:​ unsupported; head:​ unsupported; base:​ CLR byte counters do not expose exact object allocation counts; native allocations are not included.​; head:​ CLR byte counters do not expose exact object allocation counts; native allocations are not included.​
Evaluate one boolean flag Allocations per operation — — — unavailable; base:​ unsupported; head:​ unsupported; base:​ CLR byte counters do not expose exact object allocation counts; native allocations are not included.​; head:​ CLR byte counters do not expose exact object allocation counts; native allocations are not included.​
Evaluate a cohort-filtered flag Allocations per operation — — — unavailable; base:​ unsupported; head:​ unsupported; base:​ CLR byte counters do not expose exact object allocation counts; native allocations are not included.​; head:​ CLR byte counters do not expose exact object allocation counts; native allocations are not included.​
Evaluate a flag (early match) Allocations per operation — — — unavailable; base:​ unsupported; head:​ unsupported; base:​ CLR byte counters do not expose exact object allocation counts; native allocations are not included.​; head:​ CLR byte counters do not expose exact object allocation counts; native allocations are not included.​
Evaluate a flag (late match) Allocations per operation — — — unavailable; base:​ unsupported; head:​ unsupported; base:​ CLR byte counters do not expose exact object allocation counts; native allocations are not included.​; head:​ CLR byte counters do not expose exact object allocation counts; native allocations are not included.​
Evaluate a flag (no match) Allocations per operation — — — unavailable; base:​ unsupported; head:​ unsupported; base:​ CLR byte counters do not expose exact object allocation counts; native allocations are not included.​; head:​ CLR byte counters do not expose exact object allocation counts; native allocations are not included.​
Evaluate a property-filtered flag Allocations per operation — — — unavailable; base:​ unsupported; head:​ unsupported; base:​ CLR byte counters do not expose exact object allocation counts; native allocations are not included.​; head:​ CLR byte counters do not expose exact object allocation counts; native allocations are not included.​
Evaluate a regex-filtered flag Allocations per operation — — — unavailable; base:​ unsupported; head:​ unsupported; base:​ CLR byte counters do not expose exact object allocation counts; native allocations are not included.​; head:​ CLR byte counters do not expose exact object allocation counts; native allocations are not included.​
Evaluate a rollout flag Allocations per operation — — — unavailable; base:​ unsupported; head:​ unsupported; base:​ CLR byte counters do not expose exact object allocation counts; native allocations are not included.​; head:​ CLR byte counters do not expose exact object allocation counts; native allocations are not included.​
Evaluate a multivariate flag Allocations per operation — — — unavailable; base:​ unsupported; head:​ unsupported; base:​ CLR byte counters do not expose exact object allocation counts; native allocations are not included.​; head:​ CLR byte counters do not expose exact object allocation counts; native allocations are not included.​
Capture and deliver events (32-byte payload, burst) Allocated memory per operation 5.37 KiB/op 5.37 KiB/op <0.1% more memory Not flagged
Capture and deliver events (32-byte payload, burst) Time per operation 4.32 µs/op 4.34 µs/op 0.5% more time Not flagged
Capture and deliver events (32-byte payload, burst) idle_managed_heap_bytes (estimated) 823.67 KiB 822.48 KiB 0.1% less memory Not flagged
Capture and deliver events (32-byte payload, burst) Idle process memory (RSS) 55.09 MiB 55.13 MiB <0.1% more memory Not flagged
Capture and deliver events (32-byte payload, burst) Observed peak process memory (RSS) 57.68 MiB 57.73 MiB <0.1% more memory Not flagged
Capture and deliver events (32-byte payload, burst) Managed heap after settling (estimated) 2.24 MiB 2.24 MiB <0.1% less memory Not flagged
Capture and deliver events (32-byte payload, burst) Process memory after settling (RSS) 57.77 MiB 57.82 MiB <0.1% more memory Not flagged
Capture and deliver events (32-byte payload, burst) Process CPU time per operation 4.35 µs/op 4.37 µs/op 0.5% more time Not flagged
Capture and deliver events (32-byte payload, burst) Lifetime peak process memory (RSS) 57.77 MiB 57.82 MiB <0.1% more memory Not flagged
Capture and deliver events (4,096-byte payload, burst) Allocated memory per operation 39.87 KiB/op 39.87 KiB/op No observed change Not flagged
Capture and deliver events (4,096-byte payload, burst) Time per operation 15.83 µs/op 16 µs/op 1.1% more time Not flagged
Capture and deliver events (4,096-byte payload, burst) idle_managed_heap_bytes (estimated) 2.13 MiB 2.13 MiB <0.1% more memory Not flagged
Capture and deliver events (4,096-byte payload, burst) Idle process memory (RSS) 56.92 MiB 56.92 MiB <0.1% less memory Not flagged
Capture and deliver events (4,096-byte payload, burst) Observed peak process memory (RSS) 82.05 MiB 82.04 MiB <0.1% less memory Not flagged
Capture and deliver events (4,096-byte payload, burst) Managed heap after settling (estimated) 25.63 MiB 25.63 MiB <0.1% more memory Not flagged
Capture and deliver events (4,096-byte payload, burst) Process memory after settling (RSS) 82.22 MiB 82.21 MiB <0.1% less memory Not flagged
Capture and deliver events (4,096-byte payload, burst) Process CPU time per operation 17.32 µs/op 17.21 µs/op 0.6% less time Not flagged
Capture and deliver events (4,096-byte payload, burst) Lifetime peak process memory (RSS) 82.22 MiB 82.21 MiB <0.1% less memory Not flagged
Capture and deliver events (32-byte payload, steady) Allocated memory per operation 18.15 KiB/op 18.15 KiB/op No observed change Not flagged
Capture and deliver events (32-byte payload, steady) Time per operation 7.99 µs/op 8.04 µs/op 0.6% more time Not flagged
Capture and deliver events (32-byte payload, steady) idle_managed_heap_bytes (estimated) 823.68 KiB 822.48 KiB 0.1% less memory Not flagged
Capture and deliver events (32-byte payload, steady) Idle process memory (RSS) 54.99 MiB 54.99 MiB <0.1% less memory Not flagged
Capture and deliver events (32-byte payload, steady) Observed peak process memory (RSS) 55.56 MiB 55.55 MiB <0.1% less memory Not flagged
Capture and deliver events (32-byte payload, steady) Managed heap after settling (estimated) 939.48 KiB 938.29 KiB 0.1% less memory Not flagged
Capture and deliver events (32-byte payload, steady) Process memory after settling (RSS) 55.55 MiB 55.54 MiB <0.1% less memory Not flagged
Capture and deliver events (32-byte payload, steady) Process CPU time per operation 8.12 µs/op 8.21 µs/op 1% more time Not flagged
Capture and deliver events (32-byte payload, steady) Lifetime peak process memory (RSS) 55.55 MiB 55.54 MiB <0.1% less memory Not flagged
Capture and deliver events (4,096-byte payload, steady) Allocated memory per operation 30.97 KiB/op 30.97 KiB/op <0.1% more memory Not flagged
Capture and deliver events (4,096-byte payload, steady) Time per operation 13.61 µs/op 13.01 µs/op 4.4% less time Not flagged
Capture and deliver events (4,096-byte payload, steady) idle_managed_heap_bytes (estimated) 2.13 MiB 2.13 MiB <0.1% less memory Not flagged
Capture and deliver events (4,096-byte payload, steady) Idle process memory (RSS) 56.95 MiB 57.03 MiB 0.1% more memory Not flagged
Capture and deliver events (4,096-byte payload, steady) Observed peak process memory (RSS) 64.14 MiB 64.2 MiB <0.1% more memory Not flagged
Capture and deliver events (4,096-byte payload, steady) Managed heap after settling (estimated) 3.12 MiB 3.12 MiB <0.1% less memory Not flagged
Capture and deliver events (4,096-byte payload, steady) Process memory after settling (RSS) 60.7 MiB 60.8 MiB 0.2% more memory Not flagged
Capture and deliver events (4,096-byte payload, steady) Process CPU time per operation 15.93 µs/op 15.43 µs/op 3.1% less time Not flagged
Capture and deliver events (4,096-byte payload, steady) Lifetime peak process memory (RSS) 63.82 MiB 63.86 MiB <0.1% more memory Not flagged
Queue an event (32-byte payload) Allocated memory per operation 1.67 KiB/op 1.67 KiB/op No observed change Not flagged
Queue an event (32-byte payload) Time per operation 1.36 µs/op 1.35 µs/op 0.9% less time Not flagged
Queue an event (32-byte payload) Process CPU time per operation 1.37 µs/op 1.36 µs/op 1% less time Not flagged
Queue an event (4,096-byte payload) Allocated memory per operation 1.67 KiB/op 1.67 KiB/op No observed change Not flagged
Queue an event (4,096-byte payload) Time per operation 1.28 µs/op 1.28 µs/op 0.2% less time Not flagged
Queue an event (4,096-byte payload) Process CPU time per operation 1.29 µs/op 1.29 µs/op <0.1% less time Not flagged
Evaluate all 10 flags Allocated memory per operation 22.43 KiB/op 22.43 KiB/op No observed change Not flagged
Evaluate all 10 flags Time per operation 28.35 µs/op 28.41 µs/op 0.2% more time Not flagged
Evaluate all 10 flags Process CPU time per operation 28.36 µs/op 28.42 µs/op 0.2% more time Not flagged
Evaluate all 100 flags Allocated memory per operation 217.11 KiB/op 217.11 KiB/op No observed change Not flagged
Evaluate all 100 flags Time per operation 258.13 µs/op 257.79 µs/op 0.1% less time Not flagged
Evaluate all 100 flags Process CPU time per operation 258.22 µs/op 257.86 µs/op 0.1% less time Not flagged
Evaluate all 1,000 flags Allocated memory per operation 2.11 MiB/op 2.11 MiB/op No observed change Not flagged
Evaluate all 1,000 flags Time per operation 2.22 ms/op 2.22 ms/op <0.1% more time Not flagged
Evaluate all 1,000 flags Process CPU time per operation 2.22 ms/op 2.22 ms/op <0.1% more time Not flagged
Evaluate 1,000 flags under concurrent load idle_managed_heap_bytes (estimated) 4.77 MiB 4.81 MiB 0.9% more memory Not flagged
Evaluate 1,000 flags under concurrent load Idle process memory (RSS) 108.13 MiB 108.14 MiB <0.1% more memory Not flagged
Evaluate 1,000 flags under concurrent load Observed peak process memory (RSS) 113.86 MiB 113.85 MiB <0.1% less memory Not flagged
Evaluate 1,000 flags under concurrent load Managed heap after settling (estimated) 4.87 MiB 4.91 MiB 0.9% more memory Not flagged
Evaluate 1,000 flags under concurrent load Process memory after settling (RSS) 113.97 MiB 113.96 MiB <0.1% less memory Not flagged
Evaluate 1,000 flags under concurrent load Lifetime peak process memory (RSS) 113.97 MiB 113.96 MiB <0.1% less memory Not flagged
Refresh 1,000 flag definitions idle_managed_heap_bytes (estimated) 19.6 MiB 19.6 MiB No observed change Not flagged
Refresh 1,000 flag definitions Idle process memory (RSS) 140.59 MiB 140.88 MiB 0.2% more memory Not flagged
Refresh 1,000 flag definitions Observed peak process memory (RSS) 149.09 MiB 149.18 MiB <0.1% more memory Not flagged
Refresh 1,000 flag definitions Managed heap after settling (estimated) 20.59 MiB 20.59 MiB No observed change Not flagged
Refresh 1,000 flag definitions Process memory after settling (RSS) 148.05 MiB 148.13 MiB <0.1% more memory Not flagged
Refresh 1,000 flag definitions Lifetime peak process memory (RSS) 148.48 MiB 148.67 MiB 0.1% more memory Not flagged
Evaluate one boolean flag Allocated memory per operation 1.68 KiB/op 1.68 KiB/op No observed change Not flagged
Evaluate one boolean flag Time per operation 2.2 µs/op 2.18 µs/op 0.9% less time Not flagged
Evaluate one boolean flag Process CPU time per operation 2.2 µs/op 2.18 µs/op 0.9% less time Not flagged
Evaluate a cohort-filtered flag Allocated memory per operation 1.94 KiB/op 1.94 KiB/op No observed change Not flagged
Evaluate a cohort-filtered flag Time per operation 2.23 µs/op 2.24 µs/op 0.4% more time Not flagged
Evaluate a cohort-filtered flag Process CPU time per operation 2.23 µs/op 2.24 µs/op 0.4% more time Not flagged
Evaluate a flag (early match) Allocated memory per operation 3.54 KiB/op 3.54 KiB/op No observed change Not flagged
Evaluate a flag (early match) Time per operation 3.54 µs/op 3.52 µs/op 0.5% less time Not flagged
Evaluate a flag (early match) Process CPU time per operation 3.54 µs/op 3.52 µs/op 0.5% less time Not flagged
Evaluate a flag (late match) Allocated memory per operation 5.14 KiB/op 5.14 KiB/op No observed change Not flagged
Evaluate a flag (late match) Time per operation 4.65 µs/op 4.64 µs/op <0.1% less time Not flagged
Evaluate a flag (late match) Process CPU time per operation 4.65 µs/op 4.64 µs/op <0.1% less time Not flagged
Evaluate a flag (no match) Allocated memory per operation 4.93 KiB/op 4.93 KiB/op No observed change Not flagged
Evaluate a flag (no match) Time per operation 4.07 µs/op 4.06 µs/op 0.2% less time Not flagged
Evaluate a flag (no match) Process CPU time per operation 4.07 µs/op 4.06 µs/op 0.2% less time Not flagged
Evaluate a property-filtered flag Allocated memory per operation 1.91 KiB/op 1.91 KiB/op No observed change Not flagged
Evaluate a property-filtered flag Time per operation 2.1 µs/op 2.09 µs/op 0.3% less time Not flagged
Evaluate a property-filtered flag Process CPU time per operation 2.1 µs/op 2.09 µs/op 0.3% less time Not flagged
Evaluate a regex-filtered flag Allocated memory per operation 6.34 KiB/op 6.34 KiB/op No observed change Not flagged
Evaluate a regex-filtered flag Time per operation 6.89 µs/op 7.01 µs/op 1.8% more time Not flagged
Evaluate a regex-filtered flag Process CPU time per operation 6.9 µs/op 7.02 µs/op 1.8% more time Not flagged
Evaluate a rollout flag Allocated memory per operation 1.78 KiB/op 1.78 KiB/op No observed change Not flagged
Evaluate a rollout flag Time per operation 2.63 µs/op 2.62 µs/op 0.7% less time Not flagged
Evaluate a rollout flag Process CPU time per operation 2.63 µs/op 2.62 µs/op 0.7% less time Not flagged
Evaluate a multivariate flag Allocated memory per operation 1.82 KiB/op 1.82 KiB/op No observed change Not flagged
Evaluate a multivariate flag Time per operation 2.35 µs/op 2.34 µs/op 0.5% less time Not flagged
Evaluate a multivariate flag Process CPU time per operation 2.36 µs/op 2.34 µs/op 0.5% less time Not flagged

Values are medians of paired measurements. Not flagged does not mean unchanged. Unavailable means a measurement could not be provided, not zero. Estimated allocation measurements retain their instrumentation uncertainty. RSS measures the whole process, not just SDK allocations; observed peaks are sampled checkpoints. Paired ranges in the diagnostics describe variability, not confidence intervals.

Compared f69acdb32159b5d404614a8a9438b4a6adbb470d → 3ce8262fc3cbfaa1bdfe080b2b5149a95ec3bc3c.

Full report and diagnostics

108 metric rows; 108 rows shown in all results. Omitted or shortened data remain in comparison.json, including per-runner environments, resource limits, measurement methods, samples and checkpoints.

@mayteio
mayteio marked this pull request as ready for review December 1, 2026 20:48
@mayteio
mayteio requested a review from a team as a code owner December 1, 2026 20:48
@veria-ai

veria-ai Bot commented Dec 1, 2026 •

Copy link
Copy Markdown

PR overview

No security issues were found in this pull request.

Reviews

@dustinbyrne dustinbyrne left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good: additive, matches sdk-specs emails and the backend headers/tags serializer, and keys and values go out unchanged.

Follow-up: Once this ships, posthog.com needs a couple of updates:

  • contents/docs/libraries/dotnet/index.mdx (the SendCodeEmailOptions table) needs Headers and Tags rows.
  • The test-sender refusal lists in workflows/email/test-sender.mdx:31, workflows/transactional/retries-and-errors.mdx:40 and workflows/reference/limits.mdx:116 leave out headers and tags, although the backend refuses them with sandbox_fields_unsupported (transactional_email.py L959–969) and send-from-code.mdx:222 lists them.

Not blocking for this PR.

AI-assisted review.

Comment thread src/PostHog/Emails/SendEmailOptions.cs Outdated
/// <remarks>
/// At most 8 headers. PostHog takes <c>In-Reply-To</c>, <c>References</c>, <c>List-Unsubscribe</c>,
/// <c>List-Unsubscribe-Post</c>, <c>List-Id</c> and any <c>X-</c> header, except <c>X-PostHog-</c> and
/// <c>X-SES-</c> headers. A value is at most 870 ASCII characters without line breaks; only an <c>X-</c> header

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggestion: These remarks read as PostHog's full rule list, but the backend refuses a few more cases with invalid_header:

  • names that differ only by case (code_send_fields.py L287–291, names_ignore_case). A default Dictionary<string, string> allows { ["X-Ref"] = "a", ["x-ref"] = "b" }.
  • an empty value (L325, 0 < len(value))
  • any control character, not only line breaks (L48/L331)
  • an X- name with characters other than letters, digits and hyphens, or longer than 77 characters (L58/L322)

The Tags remarks already say "1 to 256", so consider matching that here, for example:

"At most 8 headers, each named once, ignoring case. PostHog takes In-Reply-To, References, List-Unsubscribe, List-Unsubscribe-Post, List-Id and any X- header named with letters, digits and hyphens, except X-PostHog- and X-SES- headers. A value is 1 to 870 ASCII characters without line breaks or other control characters; only an X- header takes non-ASCII text, at most 200 UTF-8 bytes."

This is docs-only. The client should keep not checking these (sdk-specs emails L179). The published send-from-code page (L176) has the same gap.

@mayteio
mayteio merged commit 86bcaf2 into main Dec 2, 2026
22 of 23 checks passed
@mayteio
mayteio deleted the feat/emails-headers-tags branch December 2, 2026 14:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants