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:
We will replace the logo, change the colors and we will also have some text related changes.
Replacing the logo
In order to replace the logo you should find and modify the current part in the blockednotification.xsl file:
<
a
href
=
"https://www.opswat.com/products/metadefender/email-security"
>
<
img
src
=
"img/logo.png"
/>
</
a
>
Let's assume that we have a newlogo.png image in the img folder. In this case we should modify this part to look like this:
<
a
href
=
"https://www.opswat.com"
>
<
img
src
=
"img/newlogo.png"
/>
</
a
>
By modifying the href part the new logo will point to http://www.opswat.com instead of https://www.opswat.com/products/metadefender/email-security.
After these modifications the notification email will look like this:
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.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:
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:
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:
<
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:
<
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:
We can also change the text direction to right-to-left by adding dir="rtl" to the html element:
<
html
xmlns
=
"http://www.w3.org/1999/xhtml"
dir
=
"rtl"
>
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:
<
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: