How to create and use nested templates in Outlook

In this article I’ll show you how to create nested templates on Outlook using datasets. You’ll see different approaches of nesting templates and then I’ll teach you adding dynamic fields and fill in your emails on the fly.

Before showing you how to create nested templates in Outlook, I’d like to take a small break and introduce you to our Shared Email Templates add-in. With this little app you can not only create templates for future emails, but also apply formatting, paste hyperlinks, images and tables. Moreover, you may paste several templates in one email in a click.

Ok, let’s begin :)

Create nested templates using shortcuts in datasets

First off, let’s clarify what is a shortcut in terms of Shared Email Templates. In simple words, it is a link to a given template. When you create a template, there is a field with two hashtags at the top of the add-in’s pane. This would be your shortcut. If you fill it in, your template will be associated with this shortcut.
The shortcut field on the add-in’s pane.

Tip. You may easily define which templates have shortcuts assigned by the bid hashtag sign next to the template’s name:
The view of the shortcuts on the Shared Email Templates pane.

Thus, if you need the text from this template with shortcut to be added to the content of another template, there is no need to manually copy and paste it. Just type its shortcut and the whole template will be pasted.

Now it’s time to see how shortcuts work in datasets. Firstly, I’ll create three templates and assign shortcuts for each of them.

Tip. If you feel like you need some more info about datasets, just refer to my Fillable templates from datasets tutorial, I’ve got this topic covered there.

My templates will contain a short description of some product subscription plans. I’ll also add some formatting so that my text looks brighter and, of course, assign a shortcut to each of them. Here is how it’ll look:
Sample templates with assigned shortcuts.

Now I’ll need to add those shortcuts to a dataset. So, I create a new dataset (let’s call in “Plans description”), fill in the first column with the plans’ names and enter my shortcuts next to the corresponding plan. Here is what I get in the result:

Plan Description
Current version ##current
Lifetime ##lifetime
Yearly ##yearly

As you can see, each plan is associated with the shortcut that leads to the template with its description. Why do I need all that? Because I want to make my workflow fast and easy :) All that’s left to do is to write a template and include the WhatToEnter macro to paste the necessary description into the template.

So, my final template will be the one below:

Hello!

Here is the info about the plan you've chosen:

~%WhatToEnter[{dataset:"Plans description",column:"Description",title:"choose the plan"}]

Let me know if you need any further assistance :)

The logic is the following: I paste this template, the pop-up window appears asking me to choose the plan (from the values in the first dataset column). Once I do so, the entire template associated with the corresponding shortcut gets pasted in my email.
Populate email with the shortcut from dataset to fill in a template on the fly.

Use HTML in datasets

Now I’ll show you one more trick with datasets. As you may already know, datasets can be filled with any data (text, numbers, macros and many others). In this paragraph I’ll show you how to use HTML code in datasets using the same samples from the first chapter.

Firstly, let’s open one of the templates and examine its HTML:
Open template’s HTML code.

Here is this template’s HTML code:

<p class="MsoNormal" style="margin-top: 0px; margin-bottom: 0px;"><span style="color: #0070c0;"><strong>License policy:</strong></span> you pay once and use the purchased version as long as you need.</p><p><span style="color: #4630a0;"><strong>
Upgrade policy:</strong></span> a <em>50% discount</em> for all the upgrades in the future.</p>
<p><span style="color: #375623;"><strong>Payment methods:</strong></span> Credit Card, PayPal</p>

As messy as it looks, everything is pretty simple. The first paragraph includes the license policy description, the second – upgrade policy, and the final one – payment methods. All the tags in the angle quotes (like style, color, strong, em) are representing the text formatting (its color, font style like bold or italic, etc.).

Now I’ll fill in my new dataset with those HTML code pieces and show you how it’ll work.

Note. You may type up to 255 characters in one dataset cell.

So, my new dataset (I called it Plans description HTML) has four columns in total: the first is the key one, the rest are the columns with plan’s description parameters. Here is how it’ll look after I fill it in completely:

Plan License Policy Upgrade policy Payment Methods
Current version <p class="MsoNormal" style="margin-top: 0px; margin-bottom: 0px;"><span style="color: #0070c0;"><strong>License policy:</strong></span> you pay once and use the purchased version as long as you need.</p> <p class="MsoNormal" style="margin-top: 0px; margin-bottom: 0px;"><span style="color: #4630a0;"><strong>Upgrade policy:</strong></span> a <em>50% discount</em> for all the upgrades in the future.</p> <p class="MsoNormal" style="margin-top: 0px; margin-bottom: 0px;"><span style="color: #375623;"><strong>Payment methods:</strong></span> Credit Card, PayPal</p>
Lifetime <p class="MsoNormal" style="margin-top: 0px; margin-bottom: 0px;"><span style="color: #0070c0;"><strong>License policy:</strong></span> you pay once and use the product <em>as long as you need</em>.</p> <p class="MsoNormal" style="margin-top: 0px; margin-bottom: 0px;"><span style="color: #4630a0;"><strong>Upgrade policy:</strong></span> you get all the <em>upgrades for free</em> lifetime.</p> <p class="MsoNormal" style="margin-top: 0px; margin-bottom: 0px;"><span style="color: #375623;"><strong>Payment methods:</strong></span> Credit Card, PayPal, Wire Transfer, Check.&nbsp;</p>
Yearly <p class="MsoNormal" style="margin-top: 0px; margin-bottom: 0px;"><span style="color: #0070c0;"><strong>License policy:</strong></span> the license is valid for<em> one year </em>after the purchase, you pay once and use the purchased version lifetime.</p> <p class="MsoNormal" style="margin-top: 0px; margin-bottom: 0px;"><span style="color: #4630a0;"><strong>Upgrade policy:</strong></span> all the <em>upgrades are free</em> during a year.</p> <p class="MsoNormal" style="margin-top: 0px; margin-bottom: 0px;"><span style="color: #375623;"><strong>Payment methods:</strong></span> Credit Card, PayPal, Wire Transfer.</p>

Now it’s about time to get back to the template and upgrade the macro there. As now I have three columns with the data to be pasted, I’ll need three WhatToEnter’s. There are two ways to go: you either add three macros specifying different columns to return the data from, or you do it once, make two copies of this macro and manually change the target column. Both solutions are fast and simple, the choice is up to you :)

So, once the final template is updated, it’ll look like that:

Hello!

Here is the license info about the plans you've chosen:

  • ~%WhatToEnter[{dataset:"Plans description HTML",column:"License Policy",title:"Choose plan"}]
  • ~%WhatToEnter[{dataset:"Plans description HTML",column:"Upgrade policy",title:"Choose plan"}]
  • ~%WhatToEnter[{dataset:"Plans description HTML",column:"Payment Methods",title:"Choose plan"}]

Let me know if you need any further assistance :)

As you can see, there are three identical macros with different target columns each. When you paste this template, you’ll be asked to choose the plan just once and the data from all the three columns will fill in your email in a blink of an eye.
An email filled with the data by the HTML code from a dataset.

Add dynamic fields to dataset

In the samples above I showed you how to paste the pre-saved data in an email. But what if you don’t know for sure what value needs to be pasted? What if you want to make a decision for each particular case? How to add some dynamism to your templates?

Imagine this case: you are often asked about the price for some of the available plans but the pricing changes quite often and there is no point in saving it in a template. In this case you should type it manually every time you are to reply to such request.

I don’t think that typing the price after pasting the template is very efficient. As we are here to learn how to save time, I’ll show you how to solve this task in a few clicks.

First off, let me remind you how dynamic fields are handled. You add the WhatToEnter macro and set it up to paste the Text value. If it says nothing to you, check how to add a dynamic text-entry field.

Here is the macro that’ll ask me to enter the necessary price:

~%WhatToEnter[price;{title:"Enter plan's price here"}]

But what if the plan is dynamic and needs to be changed as well? Set up the second macro with a dropdown list? I have a better solution for you ;)

I create a dataset with the plan names in the key column and the WhatToEnter macro above in the second one:

Plan Price
Current Version ~%WhatToEnter[price;{title:"Enter plan's price here"}]
Lifetime ~%WhatToEnter[price;{title:"Enter plan's price here"}]
Yearly ~%WhatToEnter[price;{title:"Enter plan's price here"}]

Then I connect this dataset to my template and get the following:

Hello!

Here is the current price for the ~%WhatToEnter[{dataset:"Plans pricing",column:"Plan",title:"Plan"}] plan: USD ~%WhatToEnter[{dataset:"Plans pricing",column:"Price",title:"Price"}]

Thank you.

Looks strange? See how perfectly it works!
Fill in dynamic fields from a dataset when pasting the template.

Sum up

I hope this manual showed you another way of using datasets and inspired you to give this functionality a go :) You may always install our Shared Email Templates from Microsoft AppSource and check out how the add-in works. I’m sure the vast variety of our Docs articles and blog posts will help you take the most advantage of this tool ;)

If you face any questions with the add-in, feel free to leave them in the Comments section. I’ll be happy to help you out :)

Table of contents

Post a comment



Thank you for your comment!
When posting a question, please be very clear and concise. This will help us provide a quick and relevant solution to
your query. We cannot guarantee that we will answer every question, but we'll do our best :)