-
Notifications
You must be signed in to change notification settings - Fork 1.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[AC-1693] Send InvoiceUpcoming Notification to Client Owners #3319
[AC-1693] Send InvoiceUpcoming Notification to Client Owners #3319
Conversation
b674504
to
c972048
Compare
New Issues
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You can update this PR to target billing/PM-212/billing-email-syncing
instead of master
so as to not pollute the diff with the changes in #3319. Once that PR gets merged and the branch deleted, then this PR will automatically get updated to target master
again
@cturnbull-bitwarden Good call! Done. |
src/Infrastructure.EntityFramework/Repositories/OrganizationRepository.cs
Show resolved
Hide resolved
util/Migrator/DbScripts/2023-10-03_00_OrganizationReadOwnerEmailAddresses.sql
Show resolved
Hide resolved
715bcff
to
cc5b4dd
Compare
c972048
to
a8891af
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
cc5b4dd
to
be4658c
Compare
f8354d1
to
7bebd6e
Compare
be4658c
to
27c099d
Compare
The base branch was changed.
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.
42b09d1
to
c375a64
Compare
* 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
Type of change
Objective
This PR updates our handling of the
invoice.upcoming
Stripe webhook event so that, if the incoming invoice is for an Organization, we send an email notification not only to the organization's billing address, but also to the organization's client owners.❌ This PR is based off an open PR here: #3305. Once this PR is merged, I'll rebase this PR off
master
.For review purposes, everything including and after the Add Organization_ReadOwnerEmailAddresses SPROC commit should be reviewed as part of this PR.
Code changes
2023-10-03_00_OrganizationReadOwnerEmailAddresses.sql: Adds a stored procedure to retrieve the email addresses of an organization's client owners.
IOrganizationRepository.cs: Adds
GetOwnerEmailAddressesById
method.OrganizationRepository.cs (Dapper): Adds
GetOwnerEmailAddressesById
method that invokes Stored Procedure.OrganizationRepository.cs (EF): Adds
GetOwnerEmailAddressesById
method that uses EF.IMailService.cs: Adds
SendInvoiceUpcoming
overload.HandlebarsMailService.cs: Adds
SendInvoiceUpcoming
overload.NoopMailService.cs: Adds
SendInvoiceUpcoming
overload.StripeController.cs: Updates
UpcomingInvoice
handling to send the InvoiceUpcoming email notification to both an organization's billing email and client owners separately.Before you submit
dotnet format --verify-no-changes
) (required)