Drupal 7.69 CiviCRM 5.20

We use Thank-You letters for our Year-end receipts. We use line-items for our fund accounting. If a donor gives monthly to more than 2 funds, the search result for the letter is too long to fit on one page. So it starts the next letter on the partial page. If the results are short enough, it all works great. How do I force it to start each letter on full pages?

Here is my message template code

<table border="0" style="width: 900px;">
        <td width="30%"><img height="auto" src="log url here" width="275" /></td>
        <td style="text-align:left; font-weight: bold; padding-top:60px;" width="50%">{contact.addressee}</td>
        <th style="padding-top:60px; text-align:center; color:#70551F;padding-left:100px; ">2019 Contribution Statement</th>
        <td style="text-align:left; " width="40%">{contact.street_address}</td>
        <td style="text-align:center; font-style: italic; color:#281c1d;padding-left:100px;  ">January 1, 2019 - December 31, 2019</td>
        <td width="40%">{contact.city}, {contact.state_province} {contact.postal_code}</td>
        <td style="text-align:center; font-style: italic; color:#281c1d; padding-left:100px; ">Federal Id # 27-4638772</td>
        <td colspan="2" style="text-align:center; color:#70551F; padding-top:20px; padding-bottom:20px;">____________________________________________</td>

Thank you for your support of Radius International in 2019

No goods or services were received for these Tax Deductible contributions

Date Cont ID Contribution Designation Amount {$date} {$contribution.id} {$lineitem.label} $ {$lineitem.line_total} 2019 Total Contributions $ {$contribution_aggregate}
  • Currently we add the donors that give to more than 27 line item entries in a year to a group (Group name Large#Donors). Then when we run thank you letters we filter as NOT in this group. Then run the thank-you letters and we do not have this problem. For the ones in the group, we process those one at a time. – Iowa Boy Feb 18 at 15:00

I cannot tell you how to do a page break and it probably also depends on your pdf library (e.g. dompdf or wkhtmltopdf).

You could however consider using one of the existing extensions for donation receipts to create the Year-end receipts. There are several around, one we created quite a while ago can be found here: https://github.com/systopia/de.systopia.donrec

The documentation can be found here: https://wiki.civicrm.org/confluence/display/CRM/DonationReceipts+Extension

  • 1
    I looked at that one, but we need line item info and it appeared it does not offer that detail. – Iowa Boy Jan 24 '20 at 16:44

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.