Broken event confirmation emails with multiple participants and external payment gateways (contribution.sendconfirmation)
Raised on StackExchange here: https://civicrm.stackexchange.com/questions/34004/event-email-receipt-doesnt-have-the-profile-information
We have also hit this issue.
This is an old regression from late 2019 by the looks of it.
When booking on to an event with multiple participants (ie lead booker and a guest), and using an external payment gateway using IPN, the confirmation email is missing the total amount, and all of the participant information.
Actual: image
Expected: image
Another way to recreate this issue is to call the contribution.sendconfirmation API on any contribution record linked to a lead booker that has additional participants.
IPN-based payment gateways call completetransaction API, which in turn calls the sendconfirmation API, which explains.
Tracking through the code, it looks like the sendconfirmation API call only has the participant information for the 'last' participant ID associated with the booking?
It looks like @eileen you've been doing some refactoring in this area (rightly so - it looks like a bit of a swamp!).
I'm struggling to track down exactly where the issue is coming from.