feat: extract email sending into dedicated email-api service #23
Reference in New Issue
Block a user
Delete Branch "feature/email-api"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
What
Centralise all SMTP email sending into a new internal
email-apiservice.apiandcv-search-jobstop using MailKit directly and callemail-apivia a Refit client.Why
Email-sending logic was duplicated across two services (
api/Services/SmtpEmailSender.csandcv-search-job/Services/CvSearchEmailSender.cs), each managing its own SMTP connection. Centralising it means one SMTP config point, one place to update sending logic, and easier future changes (e.g. provider swap).Changes
Apis/email-api-models/—SendEmailRequest,IEmailApiClient(Refit),EmailApiSettingsApis/email-api/—EmailController,SmtpEmailDispatcher,Program.cs,Dockerfile; wraps anyHtmlBodyfragment in a branded HTML shell (blue#2c5282header, white card, grey footer); handles optional file attachments from the shared Files volumeapi— renameSmtpEmailSender→EmailApiEmailSender; switch from MailKit toIEmailApiClient; HTML list formatting for match email strengths/gaps/recommendationscv-search-job— switchCvSearchEmailSenderto callIEmailApiClient; pass relative attachment filename instead of full pathUpdateEmailTemplatesToHtml— upgrade 8 DB templates from plain text to styled HTML (inline CSS, Gmail-compatible)docker-compose.yml— addemail-apiservice (internal, no ports); removeSmtp__*fromapi+cv-search-job; addEmailApi__*vars +depends_on: email-apimyAi.sln+CLAUDE.md— updated layout, dependency diagram, internal API key tableTesting
dotnet build myAi.sln— 0 errors, 0 warningsemail-api.csprojSmtp__*env vars present only inemail-apiservice blockRisk Assessment
Checklist
🤖 Generated with Claude Code