With dozens of Outlook emails coming weekly, your addressee can probably take just a very quick look at each of them. Picking a bright font color for the phrases that should be noticed for sure may be a good idea in such a case.
This article will explain how to automate the process of changing the font color of a paragraph, a sentence, a word, a list item, or a table cell value with a combination of a macro and a few HTML tags when using Shared Email Templates. Do not worry if you are new to the add-in and have never heard of macros before. You will be guided every step of the way :)
Suppose you need to send three similar reminders saying that your addressees should submit their projects on time. The first email is to reach them 14 days prior to the deadline. The second one has to be delivered a week after. The final reminder must be sent the day before the deadline. You are going to keep the text absolutely the same except for the time phrase. And you would like that phrase to be colored brightly and the font color to vary depending on the time left:
Dear all,
I am writing to remind you about the deadline for your projects. You should be done with them in 14 days / in 7 days / tomorrow.
Can we create an Outlook email template that will make such 'conditional formatting' possible? Sure. Here it is:
How can we do that? Let's keep this question open for a while and start with simpler tasks to get practiced first :)
Primarily intended for adding the necessary elements into the email body, the ~%WHAT_TO_ENTER macro can also be helpful in creating a handy palette that will let you switch instantly from one font color to another. You can make use of the macro to get a piece of your text colored with any of your favorites like in the screenshot below:
To achieve such a result, modify a template by taking two steps with a few sub-steps each.
The ~%WHAT_TO_ENTER macro will appear in the text of your template:
What we have now is really important, but it is just half the battle :) Editing the HTML code is needed as well.
<span~%WHAT_TO_ENTER[blue;green;red;{title:"Color"}]>piece of text</span>
<span data-set-style="color:~%WHAT_TO_ENTER[blue;green;red;{title:"Color"}]>piece of text</span>
<span data-set-style="color:~%WHAT_TO_ENTER[blue;green;red;{title:"Color"}];">piece of text</span>
<span data-set-style="color:~%WHAT_TO_ENTER[blue;green;red;{title:'Color'}];">piece of text</span>
Finally, the edited HTML code lines should be as follows:
Here is the <span data-set-style="color:~%WHAT_TO_ENTER[blue;green;red;{title:'Color'}];">piece of text</span> I'd like you to pay attention to.
It is always a good idea to double-check for typos.
Likewise, you can make it possible to pick a favorite color for any piece of the text in your template, including a paragraph, a sentence, a word, a list item, and a table cell value.
To get the whole paragraph colored, you need to put the cursor before the very first character of the target paragraph, insert the ~%WHAT_TO_ENTER macro, put your palette on the macro dropdown list, and edit the HTML code of your template by following the steps described above. The modified code lines should be similar to the ones highlighted in the screenshot below:
If they are error-free, on double-clicking the ready template, you will gain access to the palette you have just created.
Pick any color you like and get the text of your template pasted into the email body.
The process of getting a single sentence colored with any of your favorites does not differ from that of a paragraph. If all is done correctly, the corresponding extract of the HTML code of your template will be as follows:
Do not forget to click OK and Save to keep the changes you have made. Here is the result to enjoy:
Changing the font color of any word in the text of an email in the blink of an eye also requires putting your favorite colors on the list and modifying the HTML code of your template. Make sure that there are no typos in the edited code lines. Double-checking is never superfluous in such a situation.
If pasted into the email body, the template will look like in the screenshot below:
To make the solution workable for a bulleted or numbered list, follow the steps we have discussed earlier. Then double-check the edited HTML code lines. Here are the screenshots of interest:
Bulleted list
Numbered list
The resulting text in your email will be similar to the following ones:
To provide you with a selection of font colors for accentuating a table cell value, the HTML code of your template should contain a line similar to the one highlighted in the screenshot below:
If no mistakes are made in the process of modifying the template, the email body will get such a text:
Now that you know the basics, we can go further and tackle the 'conditional formatting' problem :) Here is the text in question:
Dear all,
I am writing to remind you about the deadline for your projects. You should be done with them in 14 days / in 7 days / tomorrow.
To get three emails out of one and the same template with the coloring options available for the time phrase, we need to use the ~%WHAT_TO_ENTER macro twice. First, it should appear in the template as is (without any modifications) to let us choose between the time phrases. Then, it has to be used once again (in its modified version) to provide us with a set of font colors. Here are the necessary actions:
<span~%WHAT_TO_ENTER[blue;green;red;{title:"Color"}]>~%WHAT_TO_ENTER[in 14 days;in 7 days;tomorrow;{title:"When"}]</span>.
<span data-set-style="color:~%WHAT_TO_ENTER[blue;green;red;{title:"Color"}]>~%WHAT_TO_ENTER[in 14 days;in 7 days;tomorrow;{title:"When"}]</span>.
<span data-set-style="color:~%WHAT_TO_ENTER[blue;green;red;{title:"Color"}];">~%WHAT_TO_ENTER[in 14 days;in 7 days;tomorrow;{title:"When"}]</span>.
<span data-set-style="color:~%WHAT_TO_ENTER[blue;green;red;{title:'Color'}];">~%WHAT_TO_ENTER[in 14 days;in 7 days;tomorrow;{title:"When"}]</span>.
If modified correctly, the code lines will be as follows:
You should be done with them <span data-set-style="color:~%WHAT_TO_ENTER[blue;green;red;{title:'Color'}];">~%WHAT_TO_ENTER[in 14 days;in 7 days;tomorrow;{title:"When"}]</span>.
Compare with the screenshot below:
Click OK and save these changes. From now on, each time you double-click the template to insert it into your email, two dropdown lists become available within the same window on the Shared Email Templates pane letting you pick the time phrase and the font color of interest:
This is it :)
Feel free to drop in for reading and commenting :)