1
0
mirror of https://github.com/bitwarden/server synced 2025-12-18 09:13:19 +00:00

subscription renewal reminder emails

This commit is contained in:
Kyle Spearrin
2018-05-11 08:29:23 -04:00
parent 4e6e215d35
commit 053096c1a1
16 changed files with 199 additions and 29 deletions

View File

@@ -190,6 +190,22 @@ namespace Bit.Core.Services
await _mailDeliveryService.SendEmailAsync(message);
}
public async Task SendInvoiceUpcomingAsync(string email, decimal amount, DateTime dueDate,
List<string> items, bool mentionInvoices)
{
var model = new Dictionary<string, string>
{
["vaultUrl"] = _globalSettings.BaseServiceUri.VaultWithHash,
["dueDate"] = dueDate.ToString("MMM dd, yyyy"),
["amountDue"] = amount.ToString("C")
};
var message = await CreateMessageAsync("Your Subscription Will Renew Soon", email,
"InvoiceUpcoming", model);
message.BccEmails = new List<string> { "kyle@bitwarden.com" };
await _mailDeliveryService.SendEmailAsync(message);
}
private async Task<MailMessage> CreateMessageAsync(string subject, string toEmail, string fileName,
Dictionary<string, string> model)
{