This recipe turns a record into a document. Create PDF renders an HTML template with the values of the record, and Send email attaches the file. It's meant to send invoices the moment work is finished, without a manual export.
What you'll need
An
Installationsdatabase app with these fields:Customer, a text fieldCustomer email, an email fieldSystem size (kW)andTotal, number fieldsStatus, a status field with the optionCompleted
Build the automation
Open the
Installationsapp and click the automations icon at the top right (Create and view automations).Select
New automation, then selectWhen a record is updated.In the trigger, select the field name and choose
StatusunderFIELDS.Under
And if the following conditions are met, selectAdd filter. PickStatus, thenHas changed to, thenCompleted.Select
Add action→Create PDF. The action readsCreate a PDF and save file in PDF.In
File name, enter "Invoice - " and insert theCustomerfield, followed by ".pdf".Write the template in the editor. Enter a heading such as "Invoice", then lines for the customer, the system size, and the total, inserting each field. Select
Show morefor page size, orientation, and margins. SelectShow previewto check the layout. If the invoice needs them, click•••on the action and turn onHeader and footerorPage numbersunderSettings.Select
Add action→Send email.In
To, insert theCustomer emailfield. InSubject, enter "Your invoice from Acme Solar".Write a short message. Select
Show more, thenAttach file, openSelect a field, and choosePDF, the file saved byCreate PDF. LeaveAll filesselected.Select
Create automation.
Note: The email goes to a real customer when the status changes. Test with your own address in Customer email.
The result
When an installation is set to Completed, the customer receives an email with the invoice attached, for example Invoice - Dana Whitfield.pdf, with the customer, system size, and total filled in.
Variations
Add
Update recordto store the invoice date or number on the installation.Send a copy to your accounting inbox with
Cc, which you find underShow more.Start the PDF from a single select field such as
Next step→Create invoiceinstead of a status change.Use a table in the template to list line items. Learn how to format emails and PDFs with HTML →
Learn more
FAQs
Is the PDF saved in the record?
Is the PDF saved in the record?
No, not by itself. Create PDF saves the file in the variable PDF for later actions, such as an email attachment. To keep it on the record, add Update record and add PDF to a file field with Add files.
Can I change the page size?
Can I change the page size?
Yes! Select Show more and choose from sizes such as Letter, Legal, Tabloid, A3, A4, or A5, portrait or landscape, and the margins.
Are you a developer using the Tape API for automations?
Are you a developer using the Tape API for automations?
The automation API has its own documentation for developers. Full reference: create_pdf in the developer docs →
Still have questions? Find answers and get help from community experts in the Tape community →
