3.11 Customization of notification emails

Currently there are two types of notification emails: one for quarantine reports and one for blocked contents. By default these notification emails are written in English and have an OPSWAT related style (colors, logos, texts). If you would like to change the texts or the style of the email you can do it by modifying our email templates. These templates can be found under <MetaDefender Email Gateway Security installation path>\mailagenthost\xslt (C:\Program Files\OPSWAT\Metadefender Email Security\mailagenthost\xslt by default).

Persistency of template changes

Please note that when upgrading your MetaDefender Email Gateway Security the customized templates could be overwritten by the installer. If you want to keep your modifications please make a copy of your templates before upgrading the product and copy them back after the upgrade is finished.

Customizing blocked notifications

The template for blocked notifications can be found in the blockednotification.xsl file. It is an XSLT file which contains HTML, CSS and XSLT elements. By modifying the HTML and CSS elements you can get a different look or language for your notifications. XSLT elements should not be modified as we use them to fill the email with actual data.

Example

Let's try to give a different look for our blocked notification email. The email looks like this by default:

images/download/attachments/2978954/Screenshot_from_2018-04-09_10-51-13.png

We will replace the logo, change the colors and we will also have some text related changes.

Using different colors

Let's say we would like to modify the colors for our table containing the information related to the blocked email. In this case we should modify this part:

Table colors
table.email-details .table-header { background: #2672FB; color: #FFFFFF; }
table.email-details .table-header p {font-weight: 700; white-space: nowrap;}
table.email-details tr.alt td { background: #EAEFF2; }
table.email-details tr.alt .table-header { background: #2672FB; }

Modifying the background color values we could have a style like this:

Modified table colors
table.email-details .table-header { background: #4e6691; color: #FFFFFF; }
table.email-details .table-header p {font-weight: 700; white-space: nowrap;}
table.email-details tr.alt td { background: #b1d8ef; }
table.email-details tr.alt .table-header { background: #4e6691; }

The following changes would make our notification to look like this:

images/download/attachments/2978954/Screenshot_from_2018-04-09_11-21-33.png

Changing texts

If we would like to have different texts in the notification we could just simply change or remove the text literals in the template. Let's change MetaDefender Email Gateway Security to Example Company. For this we should modify these two lines:

Text
<h6 class="body-text">MetaDefender Email Gateway Security has found problems in the following email:</h6>
Best regards,<br />MetaDefender Email Gateway Security

After the changes we have:

Modified text
<h6 class="body-text">Example Company has found problems in the following email:</h6>
Best regards,<br />Example Company

The result will look like this:

images/download/attachments/2978954/Screenshot_from_2018-04-09_11-26-28.png

We can also change the text direction to right-to-left by adding dir="rtl" to the html element:

Right-to-left
<html xmlns="http://www.w3.org/1999/xhtml" dir="rtl">

images/download/attachments/2978954/Screenshot_from_2018-04-09_11-32-45.png

Customizing quarantine reports

The template for quarantine reports can be found in the qreport.xsl file. Here we have the same rules for the modifications as in the case of customizing blocked notifications.

Notes

Removing xslt elements

However the modification of xslt elements are not recommended since it can result in missing or incorrect data, you can remove them if not having some data is your actual goal.

For example if you don't want to include the Scan result link in the notification you could remove this part from the blockednotification.xsl:

Scan result
<tr>
<td class="table-header">
<p>Scan result:</p>
</td>
<td>
<p>
<xsl:element name="a">
<xsl:attribute name="href">
<xsl:value-of select="result_link_url" />
</xsl:attribute>Click here to view scan result
</xsl:element>
</p>
</td>
</tr>

After removing these elements the email won't have the Scan result row:

images/download/attachments/2978954/Screenshot_from_2018-04-09_12-00-25.png