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:
@ -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);
|
||||
}
|
||||
}
|
||||
|
@ -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);
|
||||
|
@ -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);
|
||||
|
Reference in New Issue
Block a user