feat: extract email sending into dedicated email-api service with HTML templates #22
Reference in New Issue
Block a user
Delete Branch "%!s()"
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
Create a new internal
email-apiservice that centralises all SMTP email sending.apiandcv-search-jobstop using MailKit directly and callemail-apivia Refit. All email body templates are upgraded from plain text to styled HTML.Why
Email sending is duplicated:
apihas a structuredSmtpEmailSenderwhilecv-search-jobreads SMTP config directly fromIConfigurationwith no settings class. Any new service that needs to send email would add a third copy. A dedicatedemail-apigives one SMTP configuration point, one place to change providers, and opens the door to retries/queueing later.Scope
Apis/email-api/— internal Web API (no exposed port; Docker-network-only athttp://email-api:8080)Apis/email-api-models/—SendEmailRequestDTO +IEmailApiClientRefit interface +EmailApiSettingsapi: replaceSmtpEmailSenderwithEmailApiEmailSender(Refit-backed); remove MailKit; deleteSmtpSettingsfromapi-modelscv-search-job: replace direct MailKit inCvSearchEmailSenderwith Refit callUpdateEmailTemplatesToHtmlinmyai-data— upgrade body templates to styled HTML (inline CSS, branded header)email-apiservice withSmtp__*vars; remove those vars fromapi+cv-search-job; addEmailApi__BaseUrl+EmailApi__InternalApiKeyto callersNot in scope
Success criteria
dotnet build myAi.sln— zero errorsMailKitreferenced only byemail-api.csprojSmtp__*env vars only inemail-apiservice blockTime tracking
Started: 2026-05-27 16:12 UTC