cPanel & WHM Version 94 has been released, and brings a slew of great updates. Take a look at what is included, and then upgrade today!

Notification Email Preview Script

Ben T shared this idea 5 years ago
Open Discussion

At the moment, it is incredibly difficult to test individual notification templates sent by cPanel. The only way to test the notification is to make a modification to a user account already active in the system, and hope that cPanel sends out the email for that particular notification correctly.


Testing modifications to the "bandwidth exceeded" template, for example, requires an administrator to change an account so that it is close to (or exceeding) its bandwidth limit and then simply wait until cPanel notices the bandwidth usage and sends out its notification to the user. If the template is faulty, then more than likely, the email notification doesn't get sent at all, and the developer has to go crawling through the logs to find out what happened.


In lieu of a full-blown notification template design tool in WHM/cPanel, this feature request proposes a script that could be run from the command line to test an individual template, using the list of templates in the Notification Templates section of the documentation.


Perhaps, something along the lines of:


  1. /scripts/testnotification --template=BandwidthUsageExceeded/User.html.tmpl --to=person@email.com

The script could perhaps pre-fill all the email variables with demonstration values to make it even easier.


If any errors were encountered with the template or delivery of the email, they could be displayed to the user at run-time, allowing a developer to quickly ascertain any problems with the notification system.

Leave a Comment
 
Attach a file