tc-mail-sender
.NET 8 MassTransit worker that consumes SendHtmlEmailCommand messages from Amazon SQS and dispatches HTML emails (with attachments) over internal SMTP via MailKit.
Health score
0 to 100 across seven weighted factors; nothing is hidden. Green is 75 and above, amber 50 to 74, red below 50. How scoring works.
Facts
| Languages | csharp |
| Frameworks | MassTransit 8, MailKit 4, FluentValidation 12, Generic Host |
| Runtimes | .NET 8 |
| Tests / CI | some / CI in place |
| Last commit | 2026-06-08 |
| Owner | Owner unknown (mapping to be curated) |
| Domain | Customer communications (system generated; curate in repo-owners.json to override) |
| Product area | Shared platform |
| Hosted | On-prem Deployed to our own machines
|
| Releases | 1 release pipeline(s): \cx\tc-mail-sender |
| Integration | masstransit, sqs, smtp |
| Source | Open in Azure DevOps |
Dependencies in context
Entanglement
loose No binding mechanisms apply: this system needs no untangling work.
Capability duplication
Part of the Mail sending family (review): Separate SQS/S3 delivery path; fold into the notifications strategy
Migration playbooks
Generated from this repo's assessment data: what is feasible, what blocks it, and the steps in order. Ratings: green means actionable now, amber means sequence other work first, red means blocked, grey means not applicable.
ZDD adoption
Ready with guardrailsClose: the deployment path exists, but specific checks are needed first, typically raising tests, auditing serialized data, or respecting a shared schema with expand and contract. Test coverage is thin; ZDD shifts the safety net onto automation.
- 2 system(s) depend on this repo; during a rolling deploy they will talk to old and new versions at once, so responses must stay compatible
- Serialized state or messages in flight (Redis or queues): new code must deserialize objects written by the previous version
- Adopt the four-stage discipline from the ZDD engineering standard: pre-deployment compatibility, deployment, feature activation behind a flag, post-release cleanup.
- Raise automated test coverage first: ZDD trades the end-of-sprint manual gate for continuous automated confidence, so the tests are the entry ticket.
- Make every change dual-version safe: backwards-compatible APIs (new major version for breaking wire changes), expand and contract for any schema change, and consumers tolerant of unknown fields.
- Audit serialized data: anything in Redis, queues or shared caches must deserialize cleanly across adjacent versions.
- Wrap behaviour changes in feature flags so code deploys dark and release becomes a business decision, not a deployment event.
- Route deployments through the Workflow Engine's automated drain, deploy, health-check, return cycle (the path proven by the first automated production run in mid-2026).
- Verify with area-scoped regression rather than the whole-platform cycle, and watch error rates after rollout with automated rollback on alert.
SQL Server exit
Not applicableNo SQL Server dependency is recorded for this repo. Nothing to migrate.
Containerisation
Ready to containeriseModern runtime, no hosted legacy transport: this service can follow the estate's proven container path (Dockerfile, shared pipeline template, ECS via Terraform).
- Add a Dockerfile and make the app read all configuration from environment variables and the secrets manager, never from machine-local files.
- Log to stdout and expose a health check endpoint so ECS can supervise it.
- Adopt the shared ci.yml pipeline template with the container parameters (awsRegion, containerAfterBuild, ecsTerraformRepo), which is exactly how the estate's existing AWS services deploy.
- Define the service in the Terraform repo, deploy to a non-production environment, then shift traffic and disarm the deployment-group release pipeline.
Recommended actions
No specific actions for this repo. It either needs only normal maintenance, or its work is covered by an estate-level action. See the full programme.
Assessment notes
tc-mail-sender
Purpose
A headless mail-dispatch worker: publishes a TC.Mail.Sender.Contracts package containing SendHtmlEmailCommand, consumes those commands from Amazon SQS via MassTransit, validates recipients (including a Travel Counsellors domain validator), builds MIME messages with a fluent builder, and sends them through the internal SMTP relay (smtp.travelcounsellors.com:25 in production; a testqa relay otherwise).
Tech stack
C# on .NET 8 Generic Host (no web endpoint). MassTransit 8.5 with AmazonSQS and AmazonS3 transports, MailKit/MimeKit for SMTP, FluentValidation 12, TC.ConnectionBroker.Aws for credential/bucket resolution, Nerdbank GitVersioning, StyleCop-style rulesets and shared Directory.Build.props. Dockerfile plus docker-compose for local runs.
Deployment
Included as prod_application with 1 release: release pipeline \cx\tc-mail-sender from build tc-mail-sender. YAML pipeline (build-tc-mail-sender.yml) uses the shared templates on Linux agents with containerAfterBuild: true (image aws-tc-mail-sender pushed to TC Docker Hub) and onPremiseDeploy: true, packing the Contracts package (net6.0/net8.0) for producers.
Dependencies
Internal: TC.ConnectionBroker + TC.ConnectionBroker.Aws (tc-connectionbroker) for AWS credentials, and TC.MassTransit.AmazonSQS conventions (no mappable source repo). External: Amazon SQS (bus transport, eu-west-1), Amazon S3 (claim-check storage), the internal SMTP relay. Notably it borrows the CX_TcStreamsMasstransitAdapterUser IAM credentials with a TODO to get its own IAM user.
Data stores
No database. Uses the CX_MailClaimCheckS3 S3 bucket as a MassTransit message-data (claim check) repository for large bodies/attachments, with a 7-day TTL.
Integration points
MassTransit over Amazon SQS inbound; SMTP outbound. Producers integrate by referencing the Contracts NuGet package and publishing commands to the bus.
Code health
One xunit test project with ~33 tests covering the MIME builder, validators and consumer — reasonable for the small codebase. Actively maintained (last commit 2026-06-08), YAML CI, but the README is untouched boilerplate and SMTP host/ports are hardcoded per-environment appsettings.
Modernisation risks
Low — modern stack, containerised, tested. Residual items: shared IAM credentials with the streams adapter (flagged TODO in code), reliance on an unauthenticated internal SMTP relay on port 25, and duplication of concern with the estate's other mail services (mail-service, mailtemplate-service) worth rationalising.