-
-
Notifications
You must be signed in to change notification settings - Fork 826
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
Offline Membership creation and renewal does not attach Invoice to emails #32036
base: master
Are you sure you want to change the base?
Conversation
🤖 Thank you for contributing to CiviCRM! ❤️ We will need to test and review this PR. 👷 Introduction for new contributors...
Quick links for reviewers...
|
Thanks @shaneonabike - I agree it would be cleaner to check
|
@eileenmcnaughton that was almost all the way there. I caught one missing element where the contribution Id was being passed to render the PDF so I changed that to the actual variable setup at the start by your suggestion. |
@shaneonabike cool - let's see if the deprecation notice pops up in the test run - otherwise we can merge as is |
There are 3 test fails - I'm re-running 2 to check but the style issue is definitely a thing civilint: civicrm-core#32036 Executed circa 2025-02-10 18:33 -08:00 ===========================[ Identify Files ]===========================
FILE: .../buildkit/build/build-5/web/src/CRM/Core/BAO/MessageTemplate.phpFOUND 2 ERRORS AFFECTING 2 LINES421 | ERROR | [x] Line indented incorrectly; expected 4 spaces,
|
Overview
It took me a while and some serious debugging to figure out what was going on here, but I finally got it.
When Memberships are renewed offline (and created offline) no Invoice is actually attached. The culprit is
Ref here
This was introduced (checking the contributionId) to prevent empty invoices via this merge in #24065. When I add the
contributionId
then things are happy again. We only noticed this problem after upgrading a client from 5.65 => 5.73.I verified that this is also the case on New Membership (offline) since the Contribution ID is not attached to the params sent either. There might be other places??
Before
No attachment (invoice.pdf) was added to the outgoing email sent for offline Memberships or Membership Renewals.
To reproduce:
Invoice.pdf
After
Attachments are not being properly generated and attached.
Repeat the steps above and this time around you will receive the email template for Membership (offilne) renewal and the
Invoice.pdf
attachment.Technical Details
It might be better to actually check if the value exists in the
modelProps
array instead, but I don't know if every call tosendTemplates
actually includes this array. It definitely would reduce duplicating data being sent and keep things cleaner.