8f90a4cfda
- 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>
195 lines
13 KiB
C#
195 lines
13 KiB
C#
using System;
|
|
using Email.Data;
|
|
using Microsoft.EntityFrameworkCore.Migrations;
|
|
|
|
#nullable disable
|
|
|
|
namespace Email.Data.Migrations
|
|
{
|
|
/// <inheritdoc />
|
|
public partial class InitialSchema : Migration
|
|
{
|
|
/// <inheritdoc />
|
|
protected override void Up(MigrationBuilder migrationBuilder)
|
|
{
|
|
migrationBuilder.EnsureSchema(
|
|
name: MigrationConstants.SchemaName);
|
|
|
|
migrationBuilder.CreateTable(
|
|
name: "Templates",
|
|
schema: MigrationConstants.SchemaName,
|
|
columns: table => new
|
|
{
|
|
Key = table.Column<string>(type: "nvarchar(128)", maxLength: 128, nullable: false),
|
|
Language = table.Column<string>(type: "nvarchar(8)", maxLength: 8, nullable: false),
|
|
Value = table.Column<string>(type: "nvarchar(max)", nullable: false),
|
|
Description = table.Column<string>(type: "nvarchar(500)", maxLength: 500, nullable: false, defaultValue: ""),
|
|
UpdatedAt = table.Column<DateTime>(type: "datetime2", nullable: false, defaultValueSql: "SYSUTCDATETIME()"),
|
|
OperatorCopy = table.Column<string>(type: "nvarchar(256)", maxLength: 256, nullable: false, defaultValue: "")
|
|
},
|
|
constraints: table =>
|
|
{
|
|
table.PrimaryKey("PK_Templates", x => new { x.Key, x.Language });
|
|
});
|
|
|
|
Seed(migrationBuilder);
|
|
}
|
|
|
|
private static void Seed(MigrationBuilder m)
|
|
{
|
|
void Row(string key, string lang, string value, string description = "")
|
|
=> m.InsertData("Templates", ["Key", "Language", "Value", "Description"], [key, lang, value, description], MigrationConstants.SchemaName);
|
|
|
|
// Match result email — subject
|
|
Row("email.match.subject", "en", "MyAi.ro CV Match: {{score}}% - {{jobLabel}}", "Subject for the CV match result email");
|
|
Row("email.match.subject", "ro", "MyAi.ro Potrivire CV: {{score}}% - {{jobLabel}}", "Subiect email rezultat potrivire CV");
|
|
|
|
// Match result email — body (HTML formatted)
|
|
Row("email.match.body", "en",
|
|
@"<h2 style=""color: #2c5282; margin-bottom: 20px; border-bottom: 3px solid #2c5282; padding-bottom: 10px;"">CV Match Report</h2>
|
|
<table style=""max-width: 500px; margin: 0 auto 30px; border-collapse: collapse; border: 1px solid #ddd;"">
|
|
<tr style=""background-color: #2c5282; color: white;"">
|
|
<td style=""padding: 12px 15px; font-weight: bold; width: 35%;"">CV ID</td>
|
|
<td style=""padding: 12px 15px;"">{{cvDocumentId}}</td>
|
|
</tr>
|
|
<tr style=""background-color: #f8f9fa;"">
|
|
<td style=""padding: 12px 15px; font-weight: bold;"">Job</td>
|
|
<td style=""padding: 12px 15px;"">{{jobLabel}}</td>
|
|
</tr>
|
|
<tr>
|
|
<td style=""padding: 12px 15px; font-weight: bold;"">URL</td>
|
|
<td style=""padding: 12px 15px;""><a href=""{{jobUrl}}"" style=""color: #2c5282; text-decoration: none;"">{{jobUrl}}</a></td>
|
|
</tr>
|
|
<tr style=""background-color: #f8f9fa;"">
|
|
<td style=""padding: 12px 15px; font-weight: bold;"">Score</td>
|
|
<td style=""padding: 12px 15px; color: #27ae60; font-weight: bold; font-size: 18px;"">{{score}}%</td>
|
|
</tr>
|
|
</table>
|
|
<h3 style=""color: #2c5282; margin-top: 25px; margin-bottom: 10px; border-bottom: 2px solid #2c5282; padding-bottom: 5px;"">Summary</h3>
|
|
<p style=""line-height: 1.6; color: #333;"">{{summary}}</p>
|
|
<h3 style=""color: #2c5282; margin-top: 25px; margin-bottom: 10px; border-bottom: 2px solid #2c5282; padding-bottom: 5px;"">Strengths</h3>
|
|
<div style=""line-height: 1.8; color: #333;"">{{strengths}}</div>
|
|
<h3 style=""color: #2c5282; margin-top: 25px; margin-bottom: 10px; border-bottom: 2px solid #2c5282; padding-bottom: 5px;"">Gaps</h3>
|
|
<div style=""line-height: 1.8; color: #333;"">{{gaps}}</div>
|
|
<h3 style=""color: #2c5282; margin-top: 25px; margin-bottom: 10px; border-bottom: 2px solid #2c5282; padding-bottom: 5px;"">Recommendations</h3>
|
|
<div style=""line-height: 1.8; color: #333;"">{{recommendations}}</div>",
|
|
"Body for the CV match result email (HTML formatted)");
|
|
Row("email.match.body", "ro",
|
|
@"<h2 style=""color: #2c5282; margin-bottom: 20px; border-bottom: 3px solid #2c5282; padding-bottom: 10px;"">Report Potrivire CV</h2>
|
|
<table style=""max-width: 500px; margin: 0 auto 30px; border-collapse: collapse; border: 1px solid #ddd;"">
|
|
<tr style=""background-color: #2c5282; color: white;"">
|
|
<td style=""padding: 12px 15px; font-weight: bold; width: 35%;"">ID Document CV</td>
|
|
<td style=""padding: 12px 15px;"">{{cvDocumentId}}</td>
|
|
</tr>
|
|
<tr style=""background-color: #f8f9fa;"">
|
|
<td style=""padding: 12px 15px; font-weight: bold;"">Job</td>
|
|
<td style=""padding: 12px 15px;"">{{jobLabel}}</td>
|
|
</tr>
|
|
<tr>
|
|
<td style=""padding: 12px 15px; font-weight: bold;"">URL</td>
|
|
<td style=""padding: 12px 15px;""><a href=""{{jobUrl}}"" style=""color: #2c5282; text-decoration: none;"">{{jobUrl}}</a></td>
|
|
</tr>
|
|
<tr style=""background-color: #f8f9fa;"">
|
|
<td style=""padding: 12px 15px; font-weight: bold;"">Scor</td>
|
|
<td style=""padding: 12px 15px; color: #27ae60; font-weight: bold; font-size: 18px;"">{{score}}%</td>
|
|
</tr>
|
|
</table>
|
|
<h3 style=""color: #2c5282; margin-top: 25px; margin-bottom: 10px; border-bottom: 2px solid #2c5282; padding-bottom: 5px;"">Rezumat</h3>
|
|
<p style=""line-height: 1.6; color: #333;"">{{summary}}</p>
|
|
<h3 style=""color: #2c5282; margin-top: 25px; margin-bottom: 10px; border-bottom: 2px solid #2c5282; padding-bottom: 5px;"">Puncte Forte</h3>
|
|
<div style=""line-height: 1.8; color: #333;"">{{strengths}}</div>
|
|
<h3 style=""color: #2c5282; margin-top: 25px; margin-bottom: 10px; border-bottom: 2px solid #2c5282; padding-bottom: 5px;"">Lipsuri</h3>
|
|
<div style=""line-height: 1.8; color: #333;"">{{gaps}}</div>
|
|
<h3 style=""color: #2c5282; margin-top: 25px; margin-bottom: 10px; border-bottom: 2px solid #2c5282; padding-bottom: 5px;"">Recomandări</h3>
|
|
<div style=""line-height: 1.8; color: #333;"">{{recommendations}}</div>",
|
|
"Corpul emailului pentru rezultatul potrivirii CV (format HTML)");
|
|
|
|
// Match result email — job search CTA footer (HTML formatted)
|
|
Row("email.match.job-search-footer", "en",
|
|
@"<hr style=""border: none; border-top: 1px solid #ddd; margin: 30px 0;"">
|
|
<p style=""margin-top: 20px; font-size: 14px; color: #333;"">Want to find more jobs matching your CV?</p>
|
|
<p style=""margin-bottom: 20px;""><a href=""{{jobSearchLink}}"" style=""background-color: #2c5282; color: white; padding: 10px 20px; text-decoration: none; border-radius: 4px; display: inline-block; font-weight: bold;"">Search Jobs</a></p>
|
|
<p style=""font-size: 12px; color: #666;"">(link valid for {{expiryDays}} days)</p>",
|
|
"Job search CTA appended to match result email (HTML formatted)");
|
|
Row("email.match.job-search-footer", "ro",
|
|
@"<hr style=""border: none; border-top: 1px solid #ddd; margin: 30px 0;"">
|
|
<p style=""margin-top: 20px; font-size: 14px; color: #333;"">Vrei să găsești mai multe joburi potrivite CV-ului tău?</p>
|
|
<p style=""margin-bottom: 20px;""><a href=""{{jobSearchLink}}"" style=""background-color: #2c5282; color: white; padding: 10px 20px; text-decoration: none; border-radius: 4px; display: inline-block; font-weight: bold;"">Caută Joburi</a></p>
|
|
<p style=""font-size: 12px; color: #666;"">(link valabil {{expiryDays}} zile)</p>",
|
|
"CTA cautare joburi adaugat la emailul de potrivire CV (format HTML)");
|
|
|
|
// Job search results email — subject
|
|
Row("email.search-results.subject", "en", "MyAi.ro: {{count}} jobs matching your CV", "Subject for job search results email");
|
|
Row("email.search-results.subject", "ro", "MyAi.ro: {{count}} joburi potrivite CV-ului tau", "Subiect email rezultate cautare joburi");
|
|
|
|
// Job search results email — body preamble (items appended in code) - HTML formatted
|
|
Row("email.search-results.body", "en",
|
|
@"<h2 style=""color: #2c5282; margin-bottom: 20px; border-bottom: 3px solid #2c5282; padding-bottom: 10px;"">Job Search Results</h2>
|
|
<p style=""margin-bottom: 20px; color: #333;"">MyAi.ro found <strong>{{count}}</strong> jobs matching your CV:</p>
|
|
<div style=""margin-top: 20px; color: #333;"">
|
|
{{items}}
|
|
</div>",
|
|
"Body preamble for job search results email (HTML formatted)");
|
|
Row("email.search-results.body", "ro",
|
|
@"<h2 style=""color: #2c5282; margin-bottom: 20px; border-bottom: 3px solid #2c5282; padding-bottom: 10px;"">Rezultate Căutare Joburi</h2>
|
|
<p style=""margin-bottom: 20px; color: #333;"">MyAi.ro a găsit <strong>{{count}}</strong> joburi potrivite CV-ului tău:</p>
|
|
<div style=""margin-top: 20px; color: #333;"">
|
|
{{items}}
|
|
</div>",
|
|
"Corpul emailului de rezultate cautare joburi (format HTML)");
|
|
|
|
// Job search results email — no results found - HTML formatted
|
|
Row("email.search-results.empty", "en",
|
|
@"<div style=""background-color: #fff3cd; border: 1px solid #ffc107; border-radius: 4px; padding: 15px; margin: 20px 0;"">
|
|
<p style=""margin: 0; color: #856404;"">
|
|
<strong>No jobs found</strong><br>
|
|
MyAi.ro found no jobs matching your CV at this moment. Please try again later or update your CV to improve your match results.
|
|
</p>
|
|
</div>",
|
|
"No results message for job search results email (HTML formatted)");
|
|
Row("email.search-results.empty", "ro",
|
|
@"<div style=""background-color: #fff3cd; border: 1px solid #ffc107; border-radius: 4px; padding: 15px; margin: 20px 0;"">
|
|
<p style=""margin: 0; color: #856404;"">
|
|
<strong>Niciun job găsit</strong><br>
|
|
MyAi.ro nu a găsit joburi potrivite CV-ului tău în acest moment. Te rugăm să încerci din nou mai târziu sau să-ți actualizezi CV-ul pentru a obține rezultate mai bune.
|
|
</p>
|
|
</div>",
|
|
"Mesaj fara rezultate pentru emailul de cautare joburi (format HTML)");
|
|
|
|
// HTML job-search start page messages
|
|
Row("html.job-search.started.title", "en", "Job search started", "Title for job search started page");
|
|
Row("html.job-search.started.message", "en", "Your job search has started. Results will be sent to your email shortly.", "Message for job search started page");
|
|
Row("html.job-search.started.title", "ro", "Căutare joburi pornită", "Titlu pagina cautare joburi pornita");
|
|
Row("html.job-search.started.message", "ro", "Căutarea joburilor a început. Rezultatele vor fi trimise pe email în scurt timp.", "Mesaj pagina cautare joburi pornita");
|
|
|
|
Row("html.job-search.already-used.title", "en", "Link already used", "Title for already-used page");
|
|
Row("html.job-search.already-used.message", "en", "This job search link has already been used.", "Message for already-used page");
|
|
Row("html.job-search.already-used.title", "ro", "Link deja folosit", "Titlu pagina link deja folosit");
|
|
Row("html.job-search.already-used.message", "ro", "Acest link de cautare joburi a fost deja folosit.", "Mesaj pagina link deja folosit");
|
|
|
|
Row("html.job-search.expired.title", "en", "Link expired", "Title for expired link page");
|
|
Row("html.job-search.expired.message", "en", "This job search link has expired. Please request a new CV match to get a fresh link.", "Message for expired link page");
|
|
Row("html.job-search.expired.title", "ro", "Link expirat", "Titlu pagina link expirat");
|
|
Row("html.job-search.expired.message", "ro", "Acest link de cautare joburi a expirat. Solicita o noua potrivire CV pentru a primi un link nou.", "Mesaj pagina link expirat");
|
|
|
|
Row("html.job-search.invalid.title", "en", "Invalid link", "Title for invalid link page");
|
|
Row("html.job-search.invalid.message", "en", "This job search link is not valid.", "Message for invalid link page");
|
|
Row("html.job-search.invalid.title", "ro", "Link invalid", "Titlu pagina link invalid");
|
|
Row("html.job-search.invalid.message", "ro", "Acest link de cautare joburi nu este valid.", "Mesaj pagina link invalid");
|
|
|
|
Row("html.job-search.error.title", "en", "Error", "Title for error page");
|
|
Row("html.job-search.error.message", "en", "An error occurred. Please try again later.", "Message for error page");
|
|
Row("html.job-search.error.title", "ro", "Eroare", "Titlu pagina eroare");
|
|
Row("html.job-search.error.message", "ro", "A apărut o eroare. Te rugăm să încerci din nou mai târziu.", "Mesaj pagina eroare");
|
|
}
|
|
|
|
/// <inheritdoc />
|
|
protected override void Down(MigrationBuilder migrationBuilder)
|
|
{
|
|
migrationBuilder.DropTable(
|
|
name: "Templates",
|
|
schema: MigrationConstants.SchemaName);
|
|
}
|
|
}
|
|
}
|