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

 

For cPanel & WHM version 11.50

Overview

cPanel & WHM can send alerts to users when someone changes their account settings or an account approaches a limit, such as bandwidth or disk quota. You can select the notifications that an account receives with the following interfaces:

The notifications use Template Toolkit templates, and resellers and system administrators can customize these templates for their hosted customers. For example, you can add your logo to a notification, or include a link to your support web site.

This document explains which notification templates are available, and how to customize these templates.

Available notification templates

cPanel & WHM stores the original templates in subdirectories under the /usr/local/cpanel/etc/icontact_templates/ directory.

Warning:

  • The system will overwrite any changes that you make to the templates in this directory. For more information about the custom templates directory, read the Customize the templates section below.
  • The location of notification templates may change in future versions of cPanel & WHM.

These templates use the notification_name.type.tmpl naming convention, where notification_name represents the name of the notification that triggers the alert and type represents the type of template.

Notification types

Notification templates use the following types:

  • subject — Subject line template, which allows you to configure the subject line of the message.
  • html or text — Message body template, which allows you to configure the body of the message.
    • html — HTML version.
    • text — Plaintext version.

If the text template does not exist, the system will derive the text template from the html template.

Notification names

The system uses the following notification templates:

SubdirectoryFile namesDescription
Accounts
  • DigestAuthResetNeeded.html.tmpl
  • DigestAuthResetNeeded.subject.tmpl

An account's domain name has changed, so the system notifies the system administrator that it has disabled Digest Authentication.

This notification template uses the following sub-template from the Accounts/includes directory:

  • DigestAuthResetNeeded.body.html.tmpl
AdminBin
  • FullBackup.html.tmpl
  • FullBackup.subject.tmpl
An account experienced a backup failure.
appconfig
  • Notify.html.tmpl
  • Notify.subject.tmpl
Application notifications.
Backup
  • Delayed.html.tmpl
  • Delayed.subject.tmpl
The system delayed a backup.
Backup
  • Disabled.html.tmpl
  • Disabled.subject.tmpl
The system disabled a backup destination for an account.
Backup
  • Failure.html.tmpl
  • Failure.subject.tmpl
The system failed to finish a backup.
Backup
  • PreBackupNotice.html.tmpl
  • PreBackupNotice.subject.tmpl
The system sends this notification before it runs a backup.
Backup
  • Success.html.tmpl
  • Success.subject.tmpl
The system finished a backup.
Backup
  • Transport.html.tmpl
  • Transport.subject.tmpl
A backup encountered transport errors.
BandwidthUsageExceeded
  • Owner.html.tmpl
  • Owner.subject.tmpl
Bandwidth overage notifications for resellers of accounts.
BandwidthUsageExceeded
  • User.html.tmpl
  • User.subject.tmpl
Bandwidth overage notifications for accounts.
ChangePassword
  • ResetRequest.html.tmpl
  • ReserRequest.subject.tmpl
A user clicks the Forgot Password link.
ChangePassword
  • User.html.tmpl
  • User.subject.tmpl
A user changes their password.
Check
  • Biglog.html.tmpl
  • Biglog.subject.tmpl
A log file is almost 2 GB in size.
Check
  • CpanelRPMs.html.tmpl
  • CpanelRPMs.subject.tmpl
The system found altered RPMs, which pose a security risk.
Check
  • EximConfig.html.tmpl
  • EximConfig.subject.tmpl

The system cannot automatically update Exim.

This notification template uses the following sub-templates from the Check/includes directory:

  • EximConfig.ConfigAttached.html.tmpl
  • EximConfig.PreserveCustomizationsHeading.html.tmpl
  • EximConfig.ResetACLBlock.html.tmpl
  • EximConfig.ResetAll.html.tmpl
  • EximConfig.ResetCFReplaceInserts.html.tmpl
  • EximConfig.ResetCustomACLS.html.tmpl
  • EximConfig.ResetHeader.html.tmpl
  • EximConfig.ResetInserts.html.tmpl
  • EximConfig.UnableToInstallCritical.html.tmpl
  • EximConfig.UnableToInstallNotCritical.html.tmpl
  • EximConfig.UpdateSteps.html.tmpl
  • EximConfig.WHMLoginSteps.html.tmpl
Check
  • Hack.html.tmpl
  • Hack.subject.tmpl
The system detects a possible root compromise.
Check
  • ImmutableFiles.html.tmpl
  • ImmutableFiles.subject.tmpl

The system cannot update cPanel & WHM due to immutable files.

This notification template uses the following sub-templates from the Check/includes directory:

  • ImmutableFiles.action.message.html.tmpl
Check
  • InvalidDomains.html.tmpl
  • InvalidDomains.subject.tmpl
The system detects invalid domains.
Check
  • IP.html.tmpl
  • IP.subject.tmpl
The system cannot resolve the hostname to the correct IP address.
Check
  • MySQL.html.tmpl
  • MySQL.subject.tmpl
The check_mysql script found corrupted database tables.
Check
  • MysqlConnection.html.tmpl
  • MysqlConnection.subject.tmpl

The system encounters a MySQL connection issue.

This notification template uses the following sub-templates from the Check/includes directory:

  • MysqlConnection.cannot_reset_remote_pass.html.tmpl
  • MysqlConnection.reset_pass_failed.html.tmpl
  • MysqlConnection.reset_pass_successful.html.tmpl
  • MysqlConnection._unable_to_auth_error.html.tmpl
  • MysqlConnection.unknown_error.html.tmpl
Check
  • Oops.html.tmpl
  • Oops.subject.tmpl
The kernel encounters an Oops error.
Check
  • Smart.html.tmpl
  • Smart.subject.tmpl
Smartcheck detects a possible hard drive failure.
Check
  • SSLCertExpired.html.tmpl
  • SSLCertExpired.subject.tmpl
A domain's SSL certificate has expired.
Check
  • SSLCertExpiresSoon.html.tmpl
  • SSLCertExpiresSoon.subject.tmpl
A domain's SSL certificate expires soon.
Check
  • ValidServerHostname.html.tmpl
  • ValidServerHostname.subject.tmpl
The system detected an invalid hostname for the server's main IP address.
chksrvd
  • Diskusage.html.tmpl
  • Diskusage.subject.tmpl
Disk usage notifications.
chksrvd
  • Hang.html.tmpl
  • Hang.subject.tmpl
The system detected a hung device and restarted it.
chksrvd
  • Notify.html.tmpl
  • Notify.subject.tmpl
Service status notifications.
CloudLinux
  • Update.html.tmpl
  • Update.subject.tmpl

The system detects a CloudLinux license and provides installation instructions.

This notification template uses the following sub-templates from the CloudLinux/includes directory:

  • Update.body.html.tmpl
Config
  • CpConfGuard.html.tmpl
  • CpConfGuard.subject.tmpl
The system has restored the cpanel.config file from settings in the cache and configuration defaults file.
ContactInfo
  • Change.html.tmpl
  • Change.subject.tmpl
Contact information change notifications.
cPHulk
  • BruteForce.html.tmpl
  • BruteForce.subject.tmpl
cPHulk brute force notifications.
cPHulk
  • Login.html.tmpl
  • Login.subject.tmpl
Login notifications.
DigestAuth
  • Disable.html.tmpl
  • Disable.subject.tmpl
An account's domain name has changed, so the system notifies the account owner that they must re-enable Digest Authentication.
DnsAdmin
  • ClusterError.html.tmpl
  • ClusterError.subject.tmpl
The system encountered an error with the DNS Cluster.
DnsAdmin
  • UnreachablePeer.html.tmpl
  • UnreachablePeer.subject.tmpl
The system was unable to contact a server in the DNS Cluster.
Horde
  • MySQLToSQLite.html.tmpl
  • MySQLToSQLite.subject.tmpl
The system failed to convert the Horde database to SQLite.
iContact
  • SendIMFailed.html.tmpl
  • SendIMFailed.subject.tmpl
The system failed to send a notification via an instant message.
ImportMyDNSdb
  • Failure.html.tmpl
  • Failure.subject.tmpl

The system fails to import zone files into the MyDNS database.

This notification template uses the following sub-templates from the ImportMyDNSdb/includes directory:

  • Failure.already_running.html.tmpl

  • Failure.cannot_connect_to_database.html.tmpl

  • Failure.cannot_get_zones.html.tmpl

  • Failure.cannot_purge_rss.html.tmpl

  • Failure.cannot_read_zone_file.html.tmpl

  • Failure.cannot_repair.html.tmpl

  • Failure.database_error.html.tmpl

  • Failure.insufficient_permissions.html.tmpl

ImportMyDNSdb
  • InProgress.html.tmpl
  • InProgress.subject.tmpl

An import of zone files into the MyDNS database is in progress.

This notification template uses the following sub-templates from the ImportMyDNSdb/includes directory:

  • InProgress.zones_imported_successfully.html.tmpl
ImportMyDNSdb
  • Success.html.tmpl

  • Success.subject.tmpl

The system successfully imports zone files into the MyDNS database.

This notification template uses the following sub-templates from the ImportMyDNSdb/includes directory:

  • Success.successful_completion.html.tmpl
  • Success.zones_imported_successfully.html.tmpl
Install
  • ClamavConnector.html.tmpl
  • ClamavConnector.subject.tmpl
The system upgrades ClamAV via the RPM system.
Install
  • Horde.html.tmpl
  • Horde.subject.tmpl
The system fails to properly convert a table in Horde.
Install
  • PackageExtension.html.tmpl
  • PackageExtension.subject.tmpl
The system renames a package extension and updates all dependent package extensions to use the new filename due to a name conflict.
installbandwidth
  • Notify.html.tmpl
  • Notify.subject.tmpl
The system does not have enough free disk space to upgrade bandwidth files.
killacct
  • Notify.html.tmpl
  • Notify.subject.tmpl
Account termination notifications.
killacct
  • PostTerminateCleanup.html.tmpl
  • PostTerminateCleanup.subject.tmpl
The system cleaned up file permissions after a user termination.
Logd
  • Notify.html.tmpl
  • Notify.subject.tmpl
The system timed out while it processed a domain's bandwidth data.
Logger
  • Notify.html.tmpl
  • Notify.subject.tmpl
The system performed a deprecated call within a script and terminated the script.
migrate_branding
  • Notify.html.tmpl
  • Notify.subject.tmpl
Branding upgrade compatibility warning notifications.
NSD
  • BadZones.html.tmpl
  • BadZones.subject.tmpl

The system detected corrupt DNS zones.

This notification template uses the following sub-templates from the NSD/includes directory:

  • BadZones.body.html.tmpl
Quota
  • DiskWarning.html.tmpl
  • DiskWarning.subject.tmpl
Disk quota warning notifications.
Quota
  • List.html.tmpl
  • List.subject.tmpl
Mailbox quota warning notifications for multiple mailboxes.
Quota
  • MailboxWarning.html.tmpl
  • MailboxWarning.subject.tmpl
Mailbox quota warning notifications for a single mailbox.
Quota
  • RebootRequired.html.tmpl
  • RebootRequired.subject.tmpl
The system requires a reboot in order to enable filesystem quotas.
Quota
  • SetupComplete.html.tmpl
  • SetupComplete.subject.tmpl
The system successfully finished the process to enable filesystem quotas.
RPMVersions
  • Notify.html.tmpl
  • Notify.subject.tmpl
The system converted settings in the cpupdate.conf file to settings in the local.versions file.
StuckScript
  • Notify.html.tmpl
  • Notify.subject.tmpl
The system detects a stuck script.
suspendacct
  • Notify.html.tmpl
  • Notify.subject.tmpl
Account suspension notifications.
sysup
  • Notify.html.tmpl
  • Notify.subject.tmpl
The system fails to update.
unsuspendacct
  • Notify.html.tmpl
  • Notify.subject.tmpl
Account unsuspension notifications.
upacct
  • Notify.html.tmpl
  • Notify.subject.tmpl
Account modification notifications.
upcp
  • Killed.html.tmpl
  • Killed.subject.tmpl
The system aborts or terminates an update of WHM.
upcp
  • MaintenanceFailed.html.tmpl
  • MaintenanceFailed.subject.tmpl
The upcp script fails to update WHM.
upcp
  • PostSyncCleanupFailed.html.tmpl
  • PostSyncCleanupFailed.subject.tmpl
The system fails to clean up after upcp script updates WHM.
upcp
  • UpdateNowFailed.html.tmpl
  • UpdateNowFailed.subject.tmpl
The updatenow script fails to update the system.
Update
  • Blocker.html.tmpl
  • Blocker.subject.tmpl
The system fails to update because of a version blocker.
Update
  • Now.html.tmpl
  • Now.subject.tmpl
Update failure notifications.
wwwacct
  • Notify.html.tmpl
  • Notify.subject.tmpl
New account creation notifications.

Additional templates and resources

The system includes the following subdirectories:

  • include — This directory contains several useful template snippets and icons in .png file format that you may wish to use in your templates.
  • wrapper — The main notification template wrapper. Most notification templates include the code in this wrapper.

Available variables

Notification templates use two kinds of variables: CPANEL and NOTICE.

CPANEL variables

All of the notification templates can use the following two CPANELvariables:

  • locale (object) — If the system directs this notification at a user, this variable returns the user's locale. Otherwise, the variable returns the server's locale.
  • split_time_dhms (function) — This function converts a number of seconds into a four-member array that indicates days, hours, minutes, and seconds. Use it to transform system times to human-readable-times.

NOTICE variables

Each template contains a list of its allowed NOTICE variables and their descriptions.

For example, [% NOTICE.ip_address %] displays the IP address of a request.

Customize a template

To customize a template, copy the desired template from the /usr/local/cpanel/etc/icontact_templates/ directory to the /var/cpanel/templates/icontact_templates/ custom templates directory, and make your changes to the copy.

The system uses templates in the custom templates directory before it uses templates from the original directory.

Example

In the following example, Example Hosting, Inc. wants to add their company name to the subject line of their account creation notifications.

To do so, they will perform the following steps:

  1. Log in to the server via SSH as the root user.
  2. Copy the /usr/local/cpanel/etc/icontact_templates/wwwacct/Notify.subject.tmpl file to /var/cpanel/templates/icontact_templates/wwwacct/Notify.subject.tmpl location.
  3. Open the /var/cpanel/templates/icontact_templates/wwwacct/Notify.subject.tmpl file in a text editor:

    [%-
       CPANEL.locale.maketext('New account on [_1] ([_2])', NOTICE.host_server,NOTICE.domain);
    -%]
  4. Edit the Notify.subject.tmpl file to appear similar to the following example:

    [%-
       CPANEL.locale.maketext('Example Hosting, Inc.: New account on [_1] ([_2])', NOTICE.host_server,NOTICE.domain);
    -%]

 

Additional information

 

For more information on Template Toolkit, read our Guide to Template Toolkit in cPanel & WHM documentation.

For more information on localization, read our Guide to Locales documentation.

For more advanced assistance with Template Toolkit, visit the Template Toolkit website.