Invoice sending as email with PDF attachment replaces email contents with PDF contents
Overview
Sending invoices with emails, where the invoice is attached as PDF to the email, and having a freely designed email text results in the contents of the email body being replaced with the contents of the invoice PDF and nothing being attached to the email.
Ticket on stackexchange
Reproduction steps
- (Preliminary) To enable Invoicing go to Administer > CiviContribute > CiviContribute Component Settings and check the Enable Tax and Invoicing box.
- Search for a contribution for which you want to send the invoice. Select the ones you want to send an invoice in the search result.
- Choose the action Invoices - print or email.
- On the next screen select Email Invoice and fill the now displayed fields with suitable data.
- Then press Process Invoice(s). A success message should appear.
- Check the received email(s).
Current behaviour
In the received email the content of the email body is gone and replace by the content of the PDF. The email has no attachments.
Expected behaviour
The email should keep its content and the contents of the PDF should be in an attached PDF file.
Environment information
Reproduction on dmaster is not possible because emails are not sent.
- CiviCRM: 5.60.0/5.58.1/5.57.0
- PHP: 7.4.33
- CMS: Drupal 9.5.5/9.5.1
- Database: MariaDB 10.3.35
The issue occurs with the unaltered default invoice template and with an altered template.
We normally use the Invoice Helper extension but the problem also appears without the extension being enabled.
Comment
Seems to be a regression, as it has worked before.