Fix Outlook email layout and move all HTML/prompts out of code #38

Merged
claude merged 8 commits from main into staging 2026-06-01 17:30:18 +00:00
Member

Closes #37

Email layout (Outlook)

  • Table-based HTML shell; email.match.body width:100%; per-cell borders; table-based button
  • email.search-results.empty full-width table

Hardcoded HTML removed

  • email.search-results.scan-summary + item templates; CvSearchEmailSender uses IEmailTemplateService; html.job-search.shell template

AI prompt

  • keywords field added to ai.cv-match.system-prompt (en/ro)

DB actions after deploy

  • DELETE FROM [email].[Templates] WHERE [Key] LIKE 'html.job-search.%'
  • DELETE FROM [cvMatcher].[CvMatchResults]
Closes #37 ### Email layout (Outlook) - Table-based HTML shell; email.match.body width:100%; per-cell borders; table-based button - email.search-results.empty full-width table ### Hardcoded HTML removed - email.search-results.scan-summary + item templates; CvSearchEmailSender uses IEmailTemplateService; html.job-search.shell template ### AI prompt - keywords field added to ai.cv-match.system-prompt (en/ro) ### DB actions after deploy - DELETE FROM [email].[Templates] WHERE [Key] LIKE 'html.job-search.%' - DELETE FROM [cvMatcher].[CvMatchResults]
claude added 8 commits 2026-06-01 17:28:58 +00:00
- Restored email.html-shell.start and email.html-shell.end templates to InitialSchema migration
- Fixed copyright symbol: changed © to © HTML entity (avoids encoding issues in database)
- These templates wrap plain text email bodies in proper HTML structure
- Migration runs after InitialSchema, seeding the HTML wrapper templates

Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
- Convert email.match.body, email.match.job-search-footer, email.search-results.body, and email.search-results.empty templates from plain text to proper HTML format in InitialSchema migration
- Update EmailApiEmailSender.BuildMatchEmailBody() to work with HTML templates instead of plain text
- Add WebUtility.HtmlEncode() for security when inserting dynamic content (summary)
- Templates now use semantic HTML tags (table, h2, h3, ul, li, p, div, hr, a) instead of plain text with newlines
- All 32 email template variants (16 keys × 2 languages) and 8 html.job-search.* templates seeded via migration

Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
- Changed table width from 100% to max-width: 500px with margin: 0 auto
- Applies to both English and Romanian email.match.body templates
- Table now narrower and centered in email

Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
- Replace div-based layouts with table-based HTML throughout (max-width/border-radius/display:inline-block ignored by Outlook)
- email.match.body: width:100% table with per-cell borders and fixed 130px label column
- email.match.job-search-footer: table-based button with bgcolor attribute
- email.search-results.empty: div replaced with full-width table
- email.search-results.body: remove div wrapper around items
- Add email.search-results.scan-summary and email.search-results.item templates
- CvSearchEmailSender: remove all hardcoded HTML; render via IEmailTemplateService

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Replace div/CSS-class approach with nested table layout so the 600px
container is enforced via HTML attributes, not a <style> block that
Outlook strips. Also removes border-radius and display:inline-block.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
The LLM JSON shape was missing the keywords array so res.Keywords was
always empty, causing "none detected" in job search emails. Both en/ro
prompts now include "keywords" in the required JSON shape so the LLM
extracts relevant job-search terms from the CV/job pair.

Note: the cvMatcher.CvMatchResults cache must be cleared on existing DBs
so cached responses (which lack keywords) are not served.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
The job-search status page HTML wrapper was baked into a static helper
method in CvMatcherController. Extracted to a new template key
html.job-search.shell (*) with {{title}} and {{message}} placeholders.
Added to AddTemplates seed and a new AddHtmlJobSearchShell migration
for existing DBs. Controller now calls _templates.Render() for all paths.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
These templates belong to the myAi schema (myai-data) and are read by
CvMatcherController via ITemplateService. The email-data copies were
never read by any code — removing them to avoid confusion.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
gelu approved these changes 2026-06-01 17:29:20 +00:00
claude merged commit 650505c08d into staging 2026-06-01 17:30:18 +00:00
Sign in to join this conversation.
No Reviewers
No Label
2 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: AI/myAi#38