Output

Assume that you need a HTML message for an e-shop application, similar to this:

<html>
<head>
  <title>Welcome!</title>
</head>
<body>
  <h1>Welcome Joe!</h1>
  <p>Our latest product:
  <a href="products/greenmouse.html">green mouse</a>!
</body>
</html>  

Let's say that the user’s first name depends on who the message is sent to, as defined in the profile list, and the latest product should come from a supplemental table and thus can change at any time. In this situation, you can't just enter the user’s first name and the URL and name of the latest product into the HTML. You can't use static HTML.

RPL's solution for this situation is to use a template instead of static HTML. The template contains instructions to RPL (highlighted in the following example):

<html>
<head>
  <title>Welcome!</title>
</head>
<body>
  <h1>Welcome ${profile.firstName}!</h1>
  <p>Our latest product:
  <a href="${latestProduct.url}">${latestProduct.name}</a>!
</body>
</html>   

The template is stored in the Content Library, usually like a static HTML page. But when someone launches this page, RPL transforms the template on-the-fly to plain HTML by replacing the ${...}-s with up-to-date content (e.g., replacing ${ profile.firstName} with the recipient’s name), and sends the result to the recipient’s inbox. As a result, the recipient receives the HTML without RPL instructions. The template stored in the Content Library does not change during this process, so the transformation will happen again and again for each individual. This ensures that the displayed information is always up-to-date.

Next steps

Data Retrieval

Learn more

Templates