Skip to content

Commit

Permalink
fix: skip stripe
Browse files Browse the repository at this point in the history
  • Loading branch information
miguelpeixe committed Dec 8, 2023
1 parent 03d5d97 commit 7c8e6bf
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions includes/reader-revenue/class-reader-revenue-emails.php
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,24 @@ public static function add_email_configs( $configs ) {
],
],
];

$platform = Donations::get_platform_slug();
// If using 'Stripe', remove unsupported placeholders.
$stripe_unsupported_placeholders = [
'*BILLING_FIRST_NAME*',
'*BILLING_LAST_NAME*',
'*BILLING_FREQUENCY*',
'*PRODUCT_NAME*',
];
if ( 'stripe' === $platform ) {
foreach ( $configs[ self::EMAIL_TYPES['RECEIPT'] ]['available_placeholders'] as $key => $placeholder ) {
if ( in_array( $placeholder['template'], $stripe_unsupported_placeholders ) ) {
unset( $configs[ self::EMAIL_TYPES['RECEIPT'] ]['available_placeholders'][ $key ] );
}
}
$configs[ self::EMAIL_TYPES['RECEIPT'] ]['available_placeholders'] = array_values( $configs[ self::EMAIL_TYPES['RECEIPT'] ]['available_placeholders'] );
}

return $configs;
}
}
Expand Down

0 comments on commit 7c8e6bf

Please sign in to comment.