Skip to main content

Format emails and PDFs with HTML

Format the text of an email or PDF, add links and buttons, and set the page layout of a PDF. Check the result with a preview before the automation goes live.

Written by Leo

The message of Send email and the text of Create PDF are written in HTML (the code that describes text, links, and tables on a web page). You can format the text with the editor menus, and you can edit the HTML code directly for things the menus don't offer.

The action Create a PDF and save file in PDF in a new automation for Expenses, with File name Expense report @Expense / Vendor, Layout set to Portrait, Letter, and Normal margins, Show less, and a text with the heading Expense report and the values @Expense / Vendor and @Expense / Amount

Note:

  • The menus are in the fullscreen editor. Select Open in fullscreen to format text, insert tables, buttons, and images, or edit the HTML.

  • Check a preview before you save. With Simulate variables, the preview uses values from a real record.

Format the text

To format the message of an email or the text of a PDF:

  1. Open the automation and select the Send email or Create PDF action.

  2. Hover over the text box and select Open in fullscreen. The editor shows the menus File, Edit, View, Insert, Format, and Table, plus a toolbar with font, font size, and text styles.

  3. Select text and use Format to change it, for example to make it bold or add a heading.

  4. Use Table to insert a table with a fixed number of rows. For a table with one row for each record, build it in a loop →

  5. Type @ to insert record values, for example @Contract / Title. Learn more about record values →

  6. Select Show preview, then Simulate variables to check the result.

  7. Select Create automation, or Save changes if the automation already exists.

The text box of the Expense report PDF automation in fullscreen, with the menus File, Edit, View, Insert, Format, and Table and the toolbar

To edit the HTML directly, open the editor in fullscreen and select File → Source code. It's available in Send email and Create PDF.

Add a link or a button to an email

A link lets recipients open a record or start an automation with one click.

To show the link as a button, open the editor in fullscreen and select Insert → Button. In Add a button, enter the Text. In Link to web address, type @ and select the variable, for example Link. Then choose the Alignment, the Shape (Square, Round, or Pill), and the Style (Filled or Outlined). Set the colors under Colors and the spacing under Padding. If an email program doesn't show the button style, a plain link next to the button still works.

In a Send an email action after Create a web link for the current record, opening the message in fullscreen, selecting Insert and Button, typing Approve as Text, typing @Link in Link to web address and selecting the variable Link, then choosing Pill as Shape

For a plain link, select Insert → Link. In the web address field, type @ and select the variable.

Set up a PDF

File name is always shown above the editor. Select Show more in Create PDF to see the layout settings, then Show less to hide them. The header, footer, and page numbers are in the action's ••• menu.

  • File name: the name of the file. You can add values with @. If you leave it empty, the file is called Untitled.pdf.

  • Layout: three dropdowns for the orientation, the page size, and the margins. A new action starts with Portrait and Normal margins.

  • Orientation: choose Landscape to turn the page.

  • Page size: a new action starts with Letter, or A4 if your Tape language is German. You can also choose Tabloid, Legal, A3, A5, Envelope #10, or Custom format. With Custom format, you enter the width and height.

  • Margins: you can also choose Narrow margins, Moderate margins, Wide margins, or Custom margins. With Custom margins, you set the top, right, bottom, and left margins, plus the header and footer margins when a header and footer are turned on.

  • Units: sizes and margins are shown in centimeters or inches, depending on Measurement system in Settings → Preferences.

  • Header, footer, and page numbers: open the ••• menu of Create PDF and turn on Header and footer or Page numbers under Settings.

In a new Create a PDF and save file in PDF action, selecting Show more, opening the page size Letter and choosing A4, then opening ••• with Header and footer and Page numbers under Settings

The action saves the file in a variable called PDF. Use it in a later action:

  • To attach the PDF to an email, open Attach file in Send email and select PDF.

  • To keep the PDF on the record, add Update record, select Add field, pick a file field, choose Add files, and select PDF.

Use images

To add an image to the email message or the PDF, open the editor in fullscreen, select Insert → Image, and enter the image's web address.

To show an image from a file field of the record, type @ in the web address field and choose the field's File URL.

The text box of a PDF action in fullscreen with the Insert/Edit Image dialog: the web address of the image in Source, and the fields Alternative description, Width, and Height

Let's look at an example

Let's say your solar company wants to send an installation summary to the customer. Here's how:

  1. Set the trigger to When a record is updated and add a filter: Status, Has changed to, Installed.

  2. Select Add action → Create PDF. Enter a File name such as "Installation summary " followed by the customer's name.

  3. Open the text box in fullscreen and write the summary, with a heading and a table of the installed parts.

  4. Select Show more and choose Portrait and A4.

  5. Select Add action → Send email. Insert the customer's email in To, write a short message, and select PDF under Attach file.

  6. Select Create automation.

The customer gets an email with a PDF that has their name in the file name.

Formatting errors

  • A button looks like plain text. If the email program doesn't show the button style, recipients can still use a plain link next to the button.

  • The PDF has a missing page or an extra page. Check the page size and margins, then open Show preview.

  • A PDF is created but doesn't arrive. The run shows no error. Create PDF and Send email both succeed, and the email goes out without the file. Open Send email and check that Attach file contains PDF.

Learn more

FAQs

Can I use my own fonts or a logo in a PDF?

You can add a logo, but there's no option to upload a font. Choose a font and a font size from the toolbar in the fullscreen editor. To add a logo, select Insert → Image and enter the image's web address.

Can I preview the email or PDF in a new tab?

Yes! Hover over the text box and click the icon with the tooltip Open preview in new tab.

Can I add charts to a PDF?

No, there is no option to insert charts. Automations can put text, tables, and images into a PDF.

Can I add a header and page numbers to a PDF?

Yes, open the ••• menu of Create PDF and turn on Header and footer or Page numbers under Settings. Page numbers can be 1, 2, 3, 01, 02, 03, a, b, c, A, B, C, i, ii, iii, or I, II, III. Use Start at to begin with any number.

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 →

Did this answer your question?