mirror of
https://github.com/GSA/notifications-admin.git
synced 2026-02-28 14:20:59 -05:00
When sending a letter we check how many pages it has and this number then determines how many PNG images we ask template preview for. When calculating the page count, we were getting the page count for the template as it comes from the database (so without any placeholders filled in). But filling in placeholders in a letter may cause the number of pages to change, which was the cause of the 'Letter does not have a page x' errors we were seeing from template-preview. Now, when we calculate the letter page count during sending, we take the placeholders that have already been filled in into account.