White Labeling Email Communications with Template Substitutions

In past discussions, we have talked about how substitution can be used to create dynamic emails. This drastically decreases the number of templates that need to be managed by using conditionals and looping statements. But did you know that you can also use substitution for your CSS within an email?

For companies hosting email services and providing sample templates to their customers, this capability can significantly decrease the number of email templates needed. In order to illustrate the challenges and how template substitutions can solve many of those issues, let’s create a fictional ISP who is bringing on a new customer.

A Practical Application

So, let’s imagine a fictional ISP named SuperComm; they provide corporate phone and webinar services to their customers. Emails from SuperComm to their client’s employees (e.g. sign-ups, feature updates, and personalized notices) are all branded for that specific client using their own color scheme and logos. In this example, SuperComm just acquired Graphite550 as a client and now needs to start the process of helping Graphite550 to get their employees to use the SuperComm platform. In order to do this, SuperComm’s Account Managers obtain the following information from Graphite550:

  • Color scheme: white and orange
  • Copy of Graphite550’s logo
  • Graphite550 phone support numbers
  • Graphite550 support website URL
  • Address
  • Corporate URL

Once they have this information, the account manager goes into the SuperComm repository and retrieves a copy of the 15 default emails that are used for each SuperComm customer. They then spend the next several hours branding each of these email templates with Graphite550’s information. As you can imagine, this is a very error prone process which typically needs a few iterations and the eye of a few different employees to get right. Once finished, SuperComm then needs to keep each of these templates in a repository along with all of their other 700 customers. While SuperComm has done everything they can to minimize changes by separating out the main body from headers or footers, maintaining over a thousand templates is very challenging.

So for this example, let’s take a look at the welcome email that will go out to each Graphite550 employee.

Just this one email has over 20 different fields that SuperComm uses in order to brand the email to Graphite550, which turns out to be over 65 individual replacements that have to be done by the account manager. If the other 14 templates are similar to this one, that means there are close to 1000 changes that need to be made for each customer!

So how can this be simplified? SparkPost has the capability to not only support recipient-focused personalization like ‘first_name’ and ‘accountid’ but also CSS entries, enabling per-customer white labeling. In the above example, the title line actually looks like this in the template:

<td bgcolor="{{title_background_color}}" 
align="left"><h1 style="color:{{h1_color}};"> Welcome 
to {{company_name}}&#39;s Communications Hub</h1></td>

Not only is the company name a substitution field, but so is the background color and the text color which are passed to SparkPost along with the employee personalization. Here is the global substitution data for Graphite550:

      "open_tracking" : true,
      "click_tracking" : true
  "content" :
    "template_id": "welcome",
    "use_draft_template" : false
  "substitution_data" : {
  	"h1_color" : "orange",
     "h1_fontsize" : "30px",
     "header_nav_font_color" : "green",
     "font_family" : "arial",
     "font_size" : "14px",
     "font_color" : "black",
     "footer_font_color" : "black",
     "url_color" : "blue",
     "title_background_color" : "white",
     "margin" : "0px 0px 1.35em;",
     "background" : "orange",
     "footer_background" : "white",
     "company_name" : "Graphite550",
     "company_limit" : "20",
     "company_url" : "http://www.graphite550.com",
     "logo" : "https://d.dbox.com/4355/graphite550.jpg",
     "logo_height" : "100px",
     "logo_width" : "100px",
     "addr" : "123 Graphite St",
     "zipcode" : "82722",
     "state" : "CA",
     "city" : "Frezzyno",
     "phone" : "802-832-0922"

Note: In our example, we are using inline CSS but those CSS fields could also be placed in the header, as in this example:

body {background-color:{{title_background_color}};}

h1 {

In this new approach all the account manager needs to do is to put this data into a simple web form. This form, created by their IT department, obtains the necessary data, generates a preview for confirmation, and places it into a database. With this new process, the application triggering the welcome emails to each new customer will not only obtain the personalization fields like first name, but also the branding fields. Both types of information are then sent to SparkPost so the email can be branded and personalized during the generation process.

By using branding substitution fields within each template, SuperComm can clean out their repository of 1000+ branded templates down to the original 15 that can be used for every one of their customers. As a result of this, customer acquisition costs decrease significantly and template management becomes simpler.

Now that you know this, the next question is, how can substitution simplify your life?

Happy Sending,
Jeff Goldstein

Please feel free to leave any questions about template substitutions or white labeling in the comments.