1
0
mirror of https://github.com/bitwarden/server.git synced 2025-07-08 11:24:33 -05:00

additional formatting & inclusion of org name

This commit is contained in:
Matt Portune
2020-05-19 18:22:03 -04:00
parent 9bf3a467fa
commit 545948220a
7 changed files with 10 additions and 11 deletions

View File

@ -25,7 +25,7 @@ namespace Bit.Core.Services
bool mentionInvoices);
Task SendPaymentFailedAsync(string email, decimal amount, bool mentionInvoices);
Task SendAddedCreditAsync(string email, decimal amount);
Task SendLicenseExpiredAsync(IEnumerable<string> emails, bool isOrganization);
Task SendLicenseExpiredAsync(IEnumerable<string> emails, string organizationName = null);
Task SendNewDeviceLoggedInEmail(string email, string deviceType, DateTime timestamp, string ip);
Task SendRecoverTwoFactorEmail(string email, DateTime timestamp, string ip);
}

View File

@ -279,12 +279,12 @@ namespace Bit.Core.Services
await _mailDeliveryService.SendEmailAsync(message);
}
public async Task SendLicenseExpiredAsync(IEnumerable<string> emails, bool isOrganization)
public async Task SendLicenseExpiredAsync(IEnumerable<string> emails, string organizationName = null)
{
var message = CreateDefaultMessage("License Expired", emails);
var model = new LicenseExpiredViewModel
{
IsOrganization = isOrganization
OrganizationName = organizationName,
};
await AddMessageContentAsync(message, "LicenseExpired", model);
message.Category = "LicenseExpired";

View File

@ -128,7 +128,7 @@ namespace Bit.Core.Services
org.RevisionDate = DateTime.UtcNow;
await _organizationRepository.ReplaceAsync(org);
await _mailService.SendLicenseExpiredAsync(new List<string> { org.BillingEmail }, true);
await _mailService.SendLicenseExpiredAsync(new List<string> { org.BillingEmail }, org.Name);
}
public async Task ValidateUsersAsync()
@ -219,7 +219,7 @@ namespace Bit.Core.Services
user.RevisionDate = DateTime.UtcNow;
await _userRepository.ReplaceAsync(user);
await _mailService.SendLicenseExpiredAsync(new List<string> { user.Email }, false);
await _mailService.SendLicenseExpiredAsync(new List<string> { user.Email });
}
public bool VerifyLicense(ILicense license)

View File

@ -88,7 +88,7 @@ namespace Bit.Core.Services
return Task.FromResult(0);
}
public Task SendLicenseExpiredAsync(IEnumerable<string> emails, bool isOrganization)
public Task SendLicenseExpiredAsync(IEnumerable<string> emails, string organizationName = null)
{
return Task.FromResult(0);
}