diff --git a/Controllers/APIController.cs b/Controllers/APIController.cs index 3c05161..802c120 100644 --- a/Controllers/APIController.cs +++ b/Controllers/APIController.cs @@ -466,7 +466,7 @@ namespace CarCareTracker.Controllers { return Json(new OperationResponse { Success = false, Message = "No recipients could be found with those parameters" }); } - var result = _mailHelper.NotifyUserForReminders(emailRecipients, results); + var result = _mailHelper.NotifyUserForReminders(vehicle, emailRecipients, results); operationResponses.Add(result); } if (operationResponses.All(x => x.Success)) diff --git a/Helper/MailHelper.cs b/Helper/MailHelper.cs index fc6b9fb..55871d4 100644 --- a/Helper/MailHelper.cs +++ b/Helper/MailHelper.cs @@ -8,7 +8,7 @@ namespace CarCareTracker.Helper { OperationResponse NotifyUserForRegistration(string emailAddress, string token); OperationResponse NotifyUserForPasswordReset(string emailAddress, string token); - OperationResponse NotifyUserForReminders(List emailAddresses, List reminders); + OperationResponse NotifyUserForReminders(Vehicle vehicle, List emailAddresses, List reminders); } public class MailHelper : IMailHelper { @@ -61,7 +61,7 @@ namespace CarCareTracker.Helper return new OperationResponse { Success = false, Message = StaticHelper.GenericErrorMessage }; } } - public OperationResponse NotifyUserForReminders(List emailAddresses, List reminders) + public OperationResponse NotifyUserForReminders(Vehicle vehicle, List emailAddresses, List reminders) { if (string.IsNullOrWhiteSpace(mailConfig.EmailServer)) { @@ -77,7 +77,7 @@ namespace CarCareTracker.Helper } string emailSubject = $"Vehicle Reminders From LubeLogger - {DateTime.Now.ToShortDateString()}"; //construct html table. - string emailBody = ""; + string emailBody = $"

{vehicle.Year} {vehicle.Make} {vehicle.Model} #{vehicle.LicensePlate}


UrgencyDescription
"; foreach(ReminderRecordViewModel reminder in reminders) { emailBody += $"";
UrgencyDescription
{reminder.Urgency}{reminder.Description}