Category: SharePoint 2013

Reusing Css styles in Nintex Workflow notification emails

Workflows can have a lot of notifications and customizing and reformatting them individually can take a bit of time, perhaps a better way would be to apply css styles somewhere in a single css file and reuse it through out.

Nintex Workflow uses a css file containing default styles which it embeds within emails. We can easily create a copy it with our custom styles and this way we can avoid changing css for every single notification and also if we want to apply a simple change to all notification emails, it can be simply be applied to this single file.

To do this, let’s first download the default css file. Please go to Central Administration, Nintex Workflow Management and then Global Settings, you will see a link to css file

Paste this url in the browser to download this css, it would be something like http://SharePointServer:Port/_layouts/15/NintexWorkflow/HtmlEditorStyles.css

Let’s rename this file to avoid overwriting the default and edit it.

Now to publish changes upload the new file to anywhere in layouts folder, change the link above and save it.

There a quite a few style rules in this css, Be mindful of the comments above which states that each style rule must be followed by a { on the next line and end with a } on its own line for the parser to function correctly

All have the styles have some meta data information embedded with “–ms-” prefix and this is how email editor maps styles. For example at the top there are styles for colors with –ms-color prefix and some colors, if we take the first one, -ms-color says “Dark Red” and now we see it in email editor there is a Dark Red color as well, now we change color attribute value here we can use this in the editor, we can even change names so it is easier to find.

.ntx-rteForeColor-1
{
  color: darkred;
  -ms-name: "";
  -ms-color:"Dark Red";
}

Likewise there are styles for Fonts, Headings and others. To change default font and styles in body, we can make changes in following rule

.ntx-rte-messageBody
{
  font-family: Calibri, Verdana, Arial, Sans-Serif;
  font-size: 11pt;
  color: Black;
}

One of the most frequently used one would be changing styles for tables. Default styles are listed in design tab in ribbon upon selecting a table and we can customize one these styles.

In the CSS file these styles are named with –ms-name attribute, try searching for “Table Style 2 – Medium” and then you can which style is being used. Following are rules being applied to this table design

.ntx-rteTable-1
{
  -ms-name:"Table Style 2 - Medium";
  border-width: 0px;
  border-style: none;
  border-collapse: collapse;
  font-family: Tahoma;
}

.ntx-rteTable-1 tr.ntx-rteTableHeaderRow-1
{
  margin: 10px;
  padding: 10px;
  color: #3F4D6B;
  background: #D6E8FF;
  text-align: left;
  font-size: 10pt;
  font-style: normal;
  font-family: Tahoma;
  text-transform: capitalize;
  font-weight: bold;
  border-spacing: 10px;
  line-height: 14pt;
  vertical-align: top;
}

.ntx-rteTable-1 td.ntx-rteTableHeaderFirstCol-1
{
  padding: 0in 5.4pt 0in 5.4pt;
  color: #3a4663;
  line-height: 14pt;
}

.ntx-rteTable-1 td.ntx-rteTableHeaderLastCol-1
{
  padding: 0in 5.4pt 0in 5.4pt;
  color: #3a4663;
  line-height: 14pt;
}

.ntx-rteTable-1 td.ntx-rteTableHeaderOddCol-1
{
  padding:0in 5.4pt 0in 5.4pt;
  color: #3a4663;
  line-height: 14pt;
}

.ntx-rteTable-1 td.ntx-rteTableHeaderEvenCol-1
{
  padding:0in 5.4pt 0in 5.4pt; color: #3a4663;
  line-height: 14pt;
}

.ntx-rteTable-1 tr.ntx-rteTableOddRow-1
{
  color: #666666;
  background-color: #F2F3F4;
  font-size: 10pt;
  vertical-align: top;
}

.ntx-rteTable-1 tr.ntx-rteTableEvenRow-1
{
  color: #666666;
  background-color: #E7EBF7;
  font-size: 10pt;
  vertical-align: top;
}

.ntx-rteTable-1 td.ntx-rteTableFirstCol-1
{
  padding: 0in 5.4pt 0in 5.4pt;
}

.ntx-rteTable-1 td.ntx-rteTableLastCol-1
{
  padding:0in 5.4pt 0in 5.4pt;
}

.ntx-rteTable-1 td.ntx-rteTableOddCol-1
{
  padding: 0in 5.4pt 0in 5.4pt;
}

.ntx-rteTable-1 td.ntx-rteTableEvenCol-1
{
  padding:0in 5.4pt 0in 5.4pt;
}

.ntx-rteTable-1 tr.ntx-rteTableFooterRow-1
{
  background-color: #D6E8FF;
  color: #4A5A80;
  font-weight: 500;
  font-size: 10pt;
  font-family: Tahoma;
  line-height: 11pt;
}

.ntx-rteTable-1 td.ntx-rteTableFooterFirstCol-1
{
  padding: 0in 5.4pt 0in 5.4pt;
  border-top: solid gray 1.0pt;
  text-align: left;
}

.ntx-rteTable-1 td.ntx-rteTableFooterLastCol-1
{
  padding:0in 5.4pt 0in 5.4pt;
  border-top:solid gray 1.0pt;
  text-align:left;
}

.ntx-rteTable-1 td.ntx-rteTableFooterOddCol-1
{
  padding: 0in 5.4pt 0in 5.4pt;
  text-align: left;
  border-top: solid gray 1.0pt;
}

.ntx-rteTable-1 td.ntx-rteTableFooterEvenCol-1
{
  padding: 0in 5.4pt 0in 5.4pt;
  text-align: left;
  border-top: solid gray 1.0pt;
}

I hope you find this post useful, thanks.