diff --git a/src/Core/Services/Implementations/HandlebarsMailService.cs b/src/Core/Services/Implementations/HandlebarsMailService.cs index fcae4462e..2d26b4052 100644 --- a/src/Core/Services/Implementations/HandlebarsMailService.cs +++ b/src/Core/Services/Implementations/HandlebarsMailService.cs @@ -410,10 +410,11 @@ public class HandlebarsMailService : IMailService public async Task SendLicenseExpiredAsync(IEnumerable emails, string organizationName = null) { var message = CreateDefaultMessage("License Expired", emails); - var model = new LicenseExpiredViewModel + var model = new LicenseExpiredViewModel(); + if (organizationName != null) { - OrganizationName = CoreHelpers.SanitizeForEmail(organizationName, false), - }; + model.OrganizationName = CoreHelpers.SanitizeForEmail(organizationName, false); + } await AddMessageContentAsync(message, "LicenseExpired", model); message.Category = "LicenseExpired"; await _mailDeliveryService.SendEmailAsync(message);