# Custom mail template for Email Notification Profiles This page will help you customize the template for mails through Email Notification Profiles. **Note:** This feature is available from version **\125430.** - [How to change the hostname/IPAddress of the hyperlink present in the emails?](https://www.manageengine.com/network-monitoring/help/custom-email-template.html#howtochangeostname) - [How to rebrand the emails?](https://www.manageengine.com/network-monitoring/help/custom-email-template.html#howtorebrand) - [Steps to make further customizations](https://www.manageengine.com/network-monitoring/help/custom-email-template.html#customization) **IMPORTANT!** The custom template will be rendered to emails sent from [Email Notification Profiles](https://www.manageengine.com/network-monitoring/help/email-alerts.html). Ensure there is no vulnerable content present. Kindly use at your own discretion. Given below is an image of an email following the **default** template for mails received from Email Notification Profiles. ![Custom mail templates for email notification profiles in OpManager: Default template](https://www.manageengine.com/network-monitoring/help/images/Default-mail-template.png) **Note:** - Customization can be made in **customMailTemplate.html** file and placed under **\/conf/OpManager** directory - Check if the html files are rendered properly by opening them in a browser. - Customization will apply only when the Mail Format option in the [Email Notification Profile](https://www.manageengine.com/network-monitoring/help/email-alerts.html) is selected as **HTML** or **BOTH**. - Click TestAction in the edit Notification Profile window to ensure the new template's correctness. - If you wish to undo the changes and revert to the default mail template, remove **customMailTemplate.html** and restart the product. ## How to change the hostname/IPAddress of the hyperlink present in the emails? - Make a copy of the **\/conf/OpManager/mail.html** file under the same directory, and rename the copy as **customMailTemplate.html**. - Edit the **customMailTemplate.html** file using a text editor, make the below changes and save the file. - Search for **~protocol~://~host~:~port~/** in the file and replace with the required host details. For example: http://servername:8060/ **Note:** Do the same for all occurrences in the file. - Restart the product. ![Custom mail templates for email notification profiles in OpManager: Change host name](https://www.manageengine.com/network-monitoring/help/images/custom-email-template.png) ## How to rebrand the emails? - Make a copy of the **\/conf/OpManager/mail.html** file under the same directory, and rename the copy as **customMailTemplate.html**. - Edit the **customMailTemplate.html** file using a text editor, make the below changes and save the file. - To include the company name, search for **OpManager or "~product~"** in the file and replace it with the required brand name. - To include logo, add an `html` tag with logo image source with proper syntax wherever you wish to place the logo. - Restart the product. ![Custom mail templates for email notification profiles in OpManager: Change file name to rebrand email](https://www.manageengine.com/network-monitoring/help/images/rebranding-2.png) ![Custom mail templates for email notification profiles in OpManager: Edit file name and save](https://www.manageengine.com/network-monitoring/help/images/Rebranding-1.png) ## Steps to make further customizations: 1. Use the **mail.html** file under **\/conf/OpManager** as reference and create your custom mail template with the help of the key guide given below. 2. Save your created template as **customMailTemplate.html** under **\/conf/OpManager** 3. Restart product. **Key Guide:** Below is the list of available keys that can be used in the email template (customMailTemplate.html) to append the details of the alarm that triggered the profile. You can place the required keys from the list to the html file wherever necessary. ![Custom mail templates for email notification profiles in OpManager: Using available keys to make alarm customization](https://www.manageengine.com/network-monitoring/help/images/Custom-email-template-2.png) | Key | Description | |---|---| | ~subject~ | Replaced by the content of the **Subject** field in the Notification Profile. | | ~mailmessage~ | Replaced by the content for the **Message** field in the Notification Profile. | | ~displayName~ | Replaced by the **display name of the source/device** of the alarm. | | ~message~ | Replaced by the **message** of the alarm. | | ~category~ | Replaced by the **category name of the source/device** of the alarm. | | ~stringseverity~ | Replaced by the **severity** of the alarm that triggered the profile. | | ~strModTime~ | Replaced by the **generated** time of alarm that triggered the profile. | | ~protocol~ | Replace by the **protocol (http/https)** where the product is running. | | ~host~ | Replaced by the **hostname** where the product is running. | | ~port~ | Replaced by the **port number** where the product is running. | |
| When the HTML div is added to the template, it will be replaced by the name of the Notification profile that sent the email. | | #F9F9F7 | Replaced by the color of the alarm severity. | ![Custom mail templates for email notification profiles in OpManager: Using available keys to make alarm customisations](https://www.manageengine.com/network-monitoring/help/images/Custom-email-template-1.png)