Skip to content
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

Fix: Donation confirmation email - donation description #7602

Open
wants to merge 2 commits into
base: develop
Choose a base branch
from

Conversation

alaca
Copy link
Member

@alaca alaca commented Nov 4, 2024

Description

This PR resolves the issue with the wrong donation description in the confirmation email. The problem affects V3 forms only because there is a missing meta key (_give_payment_price_id) which is used to determine the donation level. The issue is resolved by checking if the donation form is a V3 form and then comparing the donation amount with the donation level amount set in form settings.

Affects

Donation receipt email

Testing Instructions

  • Create a donation form with multiple donation levels.
  • Give each donation level a different description.
  • Donate to any level other than the first level.
  • Check the donation description in the donation confirmation

Pre-review Checklist

  • Acceptance criteria satisfied and marked in related issue
  • Relevant @unreleased tags included in DocBlocks
  • Self Review of code and UX completed

foreach ( $options as $option ) {
if (isset($option['_give_amount'], $option['_give_text'])) {
if (Money::of($option['_give_amount'], $currency )->getMinorAmount() == $donation->amount->getAmount()) {
return sprintf('%s %s %s', $form_title, $args['separator'], $option['_give_text']);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we be returning early here or overwriting the variables used by the filter?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants