mirror of
https://github.com/bitwarden/server.git
synced 2025-07-01 16:12:49 -05:00
[AC-1693] Send InvoiceUpcoming Notification to Client Owners (#3319)
* Add Organization_ReadOwnerEmailAddresses SPROC * Add IOrganizationRepository.GetOwnerEmailAddressesById * Add SendInvoiceUpcoming overload for multiple emails * Update InvoiceUpcoming handler to send multiple emails * Cy's feedback * Updates from testing Hardened against missing entity IDs in Stripe events in the StripeEventService. Updated ValidateCloudRegion to not use a refresh/expansion for the customer because the invoice.upcoming event does not have an invoice.Id. Updated the StripeController's handling of invoice.upcoming to not use a refresh/expansion for the subscription because the invoice does not have an ID. * Fix broken test
This commit is contained in:
@ -285,10 +285,21 @@ public class HandlebarsMailService : IMailService
|
||||
await _mailDeliveryService.SendEmailAsync(message);
|
||||
}
|
||||
|
||||
public async Task SendInvoiceUpcomingAsync(string email, decimal amount, DateTime dueDate,
|
||||
List<string> items, bool mentionInvoices)
|
||||
public async Task SendInvoiceUpcoming(
|
||||
string email,
|
||||
decimal amount,
|
||||
DateTime dueDate,
|
||||
List<string> items,
|
||||
bool mentionInvoices) => await SendInvoiceUpcoming(new List<string> { email }, amount, dueDate, items, mentionInvoices);
|
||||
|
||||
public async Task SendInvoiceUpcoming(
|
||||
IEnumerable<string> emails,
|
||||
decimal amount,
|
||||
DateTime dueDate,
|
||||
List<string> items,
|
||||
bool mentionInvoices)
|
||||
{
|
||||
var message = CreateDefaultMessage("Your Subscription Will Renew Soon", email);
|
||||
var message = CreateDefaultMessage("Your Subscription Will Renew Soon", emails);
|
||||
var model = new InvoiceUpcomingViewModel
|
||||
{
|
||||
WebVaultUrl = _globalSettings.BaseServiceUri.VaultWithHash,
|
||||
|
Reference in New Issue
Block a user