Skip to content

fix(mail): safely render event links and regression labels - #2527

Open
niemyjski wants to merge 1 commit into
feature/email-template-contract-testsfrom
feature/email-template-data-fixes
Open

fix(mail): safely render event links and regression labels#2527
niemyjski wants to merge 1 commit into
feature/email-template-contract-testsfrom
feature/email-template-data-fixes

Conversation

@niemyjski

Copy link
Copy Markdown
Member

Summary

  • builds the event-user mailto href as one percent-encoded value so user descriptions cannot add mail headers
  • supplies the explicit IsRegressed boolean already consumed by the production daily-summary template
  • covers hostile mailto input plus positive and negative regression-label rendering

This is stacked on #2526 so the production changes are reviewable separately from the characterization suite.

Verification

  • dotnet test tests/Exceptionless.Tests/Exceptionless.Tests.csproj -- --filter-class Exceptionless.Tests.Mail.MailerTests (29 passed)
  • git diff --check

Post-Deploy Monitoring & Validation

After deployment, verify one event-notice email containing a user description opens a prefilled mail client without creating additional recipient headers, and verify regressed/non-regressed daily-summary rows display the label only for regressed stacks.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 22ba2ac860

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".


private static string BuildMailtoHref(string emailAddress, string? body)
{
string href = $"mailto:{Uri.EscapeDataString(emailAddress)}";

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Preserve the mailto address delimiter

Uri.EscapeDataString(emailAddress) also escapes the structural @, producing links such as mailto:victim%40example.com. The mailto URI grammar requires a literal @ between the local part and domain, so strict mail handlers can treat every generated recipient as malformed or leave the recipient blank. Encode the address components while preserving the delimiter, and continue encoding the body separately.

Useful? React with 👍 / 👎.

@niemyjski
niemyjski force-pushed the feature/email-template-data-fixes branch from 22ba2ac to 3b9a74e Compare August 26, 2026 02:30
@github-actions

Copy link
Copy Markdown

Code Coverage

Package Line Rate Branch Rate Complexity Health
Exceptionless.Insulation 37% 35% 286
Exceptionless.Core 76% 67% 10269
Exceptionless.Web 85% 69% 7974
Exceptionless.AppHost 38% 41% 147
Summary 78% (25383 / 32362) 67% (11946 / 17700) 18676

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant