Fix language consistency in job search and match emails
1. Pass session.Language to MatchJobRequest in cv-search-job so the LLM uses the correct language-specific prompt for job titles and summaries. 2. Replace hardcoded "Manual job description" with a template-driven label (email.match.manual-job-label) seeded in English and Romanian, so the match email subject and Job row reflect the user's language. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -172,7 +172,7 @@ public sealed class CvMatcherController : ControllerBase
|
||||
var attachmentPath = TryGetCachedCvPath(request.CvDocumentId);
|
||||
var jobLabel = !string.IsNullOrWhiteSpace(request.JobUrl)
|
||||
? request.JobUrl
|
||||
: "Manual job description";
|
||||
: _emailSender.GetManualJobLabel(language);
|
||||
|
||||
var language = NormalizeLanguage(request.Language);
|
||||
|
||||
|
||||
@@ -61,5 +61,11 @@ namespace Api.Services.Contracts
|
||||
/// <param name="expiryDays">Number of days until the job-search link expires (shown in the footer copy).</param>
|
||||
/// <returns>Rendered HTML body string.</returns>
|
||||
string BuildMatchEmailBody(string cvDocumentId, JobMatchResponse result, string? jobLabel, string language, string? jobSearchLink = null, int expiryDays = 7);
|
||||
|
||||
/// <summary>
|
||||
/// Returns the localised label for a manually-entered job description (no URL provided).
|
||||
/// </summary>
|
||||
/// <param name="language">Two-letter language code.</param>
|
||||
string GetManualJobLabel(string language);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -239,4 +239,7 @@ public sealed class EmailApiEmailSender : IEmailSender
|
||||
_emailTemplates.Render("email.match.subject", language,
|
||||
("score", score.ToString()),
|
||||
("jobLabel", jobLabel ?? "Job"));
|
||||
|
||||
public string GetManualJobLabel(string language) =>
|
||||
_emailTemplates.Get("email.match.manual-job-label", language);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user