Adjust PDF email attachments
- 6 min.
Email templates produce documents from reports generated in Business Central, but companies often have additions to these documents, or need to send accompanying information.
Document Output gives you options for:
- adding background images to report attachments, such as a branded letterheads, a watermark or a QR code image
- stitching additional pages to the end of the report, which is often used for terms and conditions or payment information
- attaching separate additional files, for example price lists or technical instructions
Applying backgrounds and extra pages to documents
PDF options are available in the Email Template Lines FastTab of email template cards.
- Background PDF allows you to upload a branded letterhead for documents generated from a Business Central report. You have options to add different backgrounds to the first and last page if needed. In the case of a one-page PDF, you choose which of the backgrounds to use in the email template lines at the One Page Document Background column.
- Merge PDF allows you to add an extra section to the end of the generated PDF document.
Note
Merge fields can be used in Document Output for naming attachments. This is useful for giving each file a descriptive and unique name. In the example image for the sales quote email template, the File Name includes the merge field %1, which in this case references the document number.
Additional attachments
Sometimes you need to attach a separate additional file to the email template, because you don't want to combine this with the attached document. For example, a price list document might be better as a separate attachment so that the recipient can share this with colleagues without also sharing the sales invoice that accompanied it. These separate email attachments are set up in the E-Mail HTML Template page, and are shown in the Attachments FactBox. To add a new additional attachment, you can either:
- Drag and drop the file into the body text of the email.
- Select New from the Attachments FactBox menu.
Combining multiple reports into one document
When there are multiple of the same document type ready to send to the same customer or vendor, you might want to combine these into one email attachment. For example, if you have just released multiple purchase orders for the same vendor, these can be combined and sent as one email attachment, instead of sent as multiple emails to the same vendor.
You set this up in the email template's Combine documents FastTab, with the Combine Documents to one PDF option.
- Select a field to use for identifying the multiple reports. For example, the Buy-from Vendor No. field would find all released purchase orders to the same vendor.
- Enter a Combined Docs File Name in each of the enabled email template lines. This filename must include the file extension .pdf.
Alternatively, at the Combine Documents column, you could select Disable Combine to create a variant email template line for a group of recipients that need each document sent separately. You can choose to zip the multiple document attachments using the option in the Email attachments FastTab.
When an email is sent with a combined document, the Document Output log shows an entry for each of the documents sent. The Filter column shows which document numbers were combined in the email, and the Attachments column shows which of the lines contains the message with the attachment.
Scenario
In the scenario, Ester’s next step is to set up the PDF attachments for the sales invoice email template.
Ester needs to work on these tasks:
- Set a branded letterhead as the background for the PDF invoices
- Add a terms and conditions document to the end of each attachment
- Attach a privacy notice to each email as a separate attachment
Other resources
More learning resources for this topic include:
- Working with Email Templates (Continia Docs article)
- Merging PDF files (Continia Docs article)
- Setting a Background PDF (Continia Docs article)
- Attaching Files to Email Templates (Continia Docs article)
- Combining Documents into one PDF (Continia Docs article)