We Use Cookies

We use cookies to ensure that we give you the best experience on our website. If you continue to use this site we will assume that you are happy with this.

See our cookie policy.

Automation Action: Wrap HTML

Wraps text inside HTML tags with optional styling.

Built-In Action

Wraps text content inside HTML tags to create a viewable HTML page. This action is useful if you have content that you have created earlier in your Automation that you then want to wrap inside a HTML page. The resulting HTML can then be used for outgoing emails, API responses or for any other purpose.

Specify the Content To Wrap. This can contain %variable% replacements. You can use Markdown to easily render tables etc. The Markdown will be converted to HTML before being wrapped. You can also specify HTML directly (HTML should not include the body tags). You should not use HTML and Markdown combined.

You can also specify a Title, Header and Footer. These are optional. The Header and Footer can contain Markdown or HTML.

Styling

On the Style tab you can specify various styling options:

  • None - no styling will be added.
  • Default - a simple stylesheet will be added (you can edit the default stylesheet in the Server Settings).
  • Bootstrap - the page will use Bootstrap styles.

You can also specify the page Background and Foreground colors and optionally a Header Image URL.

You can optionally specify your own Style Sheet Path Or URL. If a file path is used then the file will be read and added to the page. If a URL is specified then a link to it will be added.

If the Convert CSS To Inline option is enabled then any stylesheets to will be converted to inline style attributes and the stylesheets removed. This enables the HTML to be sent via email as most email clients only support inline styles (this option cannot be used if you select the Bootstrap style option).

Meta Tags

Click the Meta Tags tab to add any Meta Tags (description, keywords, author etc). Tag values can use %variable% replacements.

Click the Preview button to preview the results.

Select the variable to receive the new HTML from the Assign To list.

Example:


<!doctype html>
<html>
  <head>
    <meta charset="utf-8">
    <meta name="viewport" value="width=device-width, initial-scale=1.0">
    <meta name="description" value="Test Page">
    <meta name="author" value="Parker Software">
    <title>Title</title>
  </head>
  <body style="color:#262626">
    <div class="container">
      <div>
        <h2>Title</h2>
        <div class="header">
          <p>Header</p>
        </div>
        <div id="ta_mainDiv">
          Hello World
        </div>
      </div>
      <div class="footer">Footer</div>
    </div>
  </body>
</html>              

The above example uses no styling. If you wanted to create your own stylesheet then you would create classes for h2 and the header & footer classes. The class ta_mainDiv will contain the wrapped content.