1
0
mirror of https://github.com/bitwarden/server.git synced 2025-07-13 05:38:25 -05:00

added credit email notification

This commit is contained in:
Kyle Spearrin
2019-02-22 21:13:34 -05:00
parent 25c8d6d043
commit c5b2a929d2
8 changed files with 60 additions and 2 deletions

View File

@ -23,6 +23,7 @@ namespace Bit.Core.Services
Task SendInvoiceUpcomingAsync(string email, decimal amount, DateTime dueDate, List<string> items,
bool mentionInvoices);
Task SendPaymentFailedAsync(string email, decimal amount, bool mentionInvoices);
Task SendAddedCreditAsync(string email, decimal amount);
Task SendNewDeviceLoggedInEmail(string email, string deviceType, DateTime timestamp, string ip);
}
}

View File

@ -251,6 +251,20 @@ namespace Bit.Core.Services
await _mailDeliveryService.SendEmailAsync(message);
}
public async Task SendAddedCreditAsync(string email, decimal amount)
{
var message = CreateDefaultMessage("Account Credit Payment Processed", email);
var model = new AddedCreditViewModel
{
WebVaultUrl = _globalSettings.BaseServiceUri.VaultWithHash,
SiteName = _globalSettings.SiteName,
Amount = amount
};
await AddMessageContentAsync(message, "AddedCredit", model);
message.MetaData.Add("SendGridCategories", new List<string> { "AddedCredit" });
await _mailDeliveryService.SendEmailAsync(message);
}
public async Task SendNewDeviceLoggedInEmail(string email, string deviceType, DateTime timestamp, string ip)
{
var message = CreateDefaultMessage($"New Device Logged In From {deviceType}", email);

View File

@ -78,6 +78,11 @@ namespace Bit.Core.Services
return Task.FromResult(0);
}
public Task SendAddedCreditAsync(string email, decimal amount)
{
return Task.FromResult(0);
}
public Task SendNewDeviceLoggedInEmail(string email, string deviceType, DateTime timestamp, string ip)
{
return Task.FromResult(0);