Skip to content

Commit

Permalink
fix regression in lib/payments sendEmailNotifications (#10069)
Browse files Browse the repository at this point in the history
should. be triggered even if transaction is void
  • Loading branch information
znarf authored Apr 27, 2024
1 parent 51aa739 commit aa18000
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions server/lib/payments.ts
Original file line number Diff line number Diff line change
Expand Up @@ -614,7 +614,7 @@ export async function associateTransactionRefundId(
* In all cases, transaction.type is CREDIT.
*
*/
export const sendEmailNotifications = (order: OrderModelInterface, transaction?: TransactionInterface): void => {
export const sendEmailNotifications = (order: OrderModelInterface, transaction?: TransactionInterface | void): void => {
debug('sendEmailNotifications');
if (
transaction &&
Expand Down Expand Up @@ -749,9 +749,7 @@ export const executeOrder = async (
order.paymentMethod.save();
}

if (transaction) {
sendEmailNotifications(order, transaction);
}
sendEmailNotifications(order, transaction);

// Register gift card emitter as collective backer too
if (transaction && transaction.UsingGiftCardFromCollectiveId) {
Expand Down

0 comments on commit aa18000

Please sign in to comment.