From 5c721c22e298f2bfe85f86bb165a30503c6c5913 Mon Sep 17 00:00:00 2001 From: Derek Holloway Date: Tue, 5 Aug 2025 21:04:37 -0700 Subject: [PATCH] Start work for auto close notify --- ToDo.yaml | 3 +++ .../BackgroundServices/JobCleanupService.cs | 16 +++++++++++++++- 2 files changed, 18 insertions(+), 1 deletion(-) diff --git a/ToDo.yaml b/ToDo.yaml index 5b512f4..75ac676 100755 --- a/ToDo.yaml +++ b/ToDo.yaml @@ -17,6 +17,9 @@ Server: JobCleanupService: Need to update notification email + CompanyEmailVerify: + Need to update notification email + Client: jobs/editor: Job Listing Skills exists but isn't implimented in the UI diff --git a/src/Server/Services/BackgroundServices/JobCleanupService.cs b/src/Server/Services/BackgroundServices/JobCleanupService.cs index fbd30fb..d943280 100644 --- a/src/Server/Services/BackgroundServices/JobCleanupService.cs +++ b/src/Server/Services/BackgroundServices/JobCleanupService.cs @@ -11,6 +11,17 @@ namespace BoredCareers.Services.TimerService { _em = em; } + public string Substitue(string message, string subString, string Replacement) { + for (int i = 0; i < (message.Length - subString.Length); i++) { + if (message.Substring(i, subString.Length) == subString) { + string before = message.Substring(0, i); + string after = message.Substring(i + subString.Length); + return before + Replacement + after; + } + } + return message; + } + protected override async Task ExecuteAsync(CancellationToken stoppingToken) { while (!stoppingToken.IsCancellationRequested) { try { @@ -37,7 +48,10 @@ namespace BoredCareers.Services.TimerService { string[] emails = await _db.GetApplicationResponseEmailFromJobListing(listing.JobListingID); foreach (string email in emails) { // Send Notify Email - _em.Send(email, EmailService.JobAutoClosedSubject, EmailService.JobAutoClosedEmail); + string emailbody = EmailService.JobAutoClosedBody; + //Substitue(emailbody, "@job", listing.JobListingID); + + _em.Send(email, EmailService.JobAutoClosedSubject, emailbody); } }