Page tree
Skip to end of metadata
Go to start of metadata

This document is for a previous release of cPanel & WHM. To view our latest documentation, visit our Home page.

For cPanel & WHM 11.46

Overview

You can customize templates for the notifications that the system sends to your cPanel users. For example, you can modify the notification template files to reflect your company's brand or services.

Notes:

  • To modify templates, you must log in as the root user.
  • To enable notifications, use the Notifications section of WHM's Tweak Settings interface (Home >> Server Configuration >> Tweak Settings).
  • Notification templates use the Template Toolkit format, and can include UTF-8 characters.

Notification template files

You can use the following notification template files:

NotificationTemplate file
Account's mailbox quota /usr/local/cpanel/src/templates/mailbox_size_warning/main.default
The root user's mailbox quota /usr/local/cpanel/src/templates/mainacct_mailbox_size_warning/main.default
Disk space quota /usr/local/cpanel/src/templates/mainacct_disk_warning/main.default
Email quota /usr/local/cpanel/src/templates/mainacct_emailquota_notifylist/main.default

Account's bandwidth quota

Note:

If you do not configure the /usr/local/cpanel/src/templates/admin_bandwidth_limit/main.default file, the system will also send this notification to the root user.

/usr/local/cpanel/src/templates/bandwidth_limit/main.default

The root user's bandwidth quota

Note:

This is a custom file that WHM does not automatically include. If you do not configure this file, the root user will receive the same bandwidth notification that other accounts receive.


/usr/local/cpanel/src/templates/admin_bandwidth_limit/main.default

Modify a notification template

Important:

  • Modify the text in the template file onlyDo not change information that is between the [% %] tags. The template will not function properly without this information.
  • If you edit these files on a Microsoft® Windows® computer, make certain to run the dos2unix command on the file to ensure that it includes proper line endings. For more information, read the dos2unix documentation.

To modify a template, perform the following steps:

  1. Create the appropriate subdirectory within the /var/cpanel/templates/ directory (for example, to create the template for notifications about mailbox quotas, create the  /var/cpanel/templates/mailbox_size_warning subdirectory). 

    Note:

    The subdirectory must match one of the options listed in the table above. 

  2. Copy the template that you want to modify into the new directory as either the main.local or the main.default file.

  3. Use your preferred text editor to make changes to the template.

Example

For example, the account mailbox notification template in the /usr/local/cpanel/src/templates/mailbox_size_warning/main.default file resembles the following example:

[% FOREACH to = tos -%]
To: [% to %]
[% END -%]
From: [% from %]
Subject: Mailbox Size Warning ([% status %]

The mailbox [% box %] is almost full.

You should remove some emails from the box as soon as possible to prevent losing any future mail, or ask the admin to upgrade your account to have a larger quota.

This mailbox is currently [% percentused %]% ([% diskused %]/[% disklimit %] Megs) full.

[% UNLESS hasgoodcontact -%]
!! Do not respond to this message. Your reply will go nowhere. !!
[% END -%]

 

To create a more personal notification, you can modify the following text:

Do not respond to this message. Your reply will go nowhere.

The new notification message might include the following text instead:

Please do not respond to this message. Your reply will not reach us. Thank you.

Note:

The system only sends notifications in one language, the language in which you write the template text. You can localize the templates for any of the events, but you cannot have separate templates for each desired language.