hook scripts for Message System

Version 1.55

Feature
Finished

Hook scripts that can be added to: /usr/local/directadmin/scripts/custom/* to be triggered anytime DA sends a notice to the Message System. You can exit with a non-zero result for any *_pre.sh script (if they exist) to suppress the message from being sent. The *_post.sh scripts don't check the exit status. The output is read in, but not used, so if you need to save anything, log it from within the script, or use the task.queue to create another message to whoever needs it. ================= SCRIPTS: ---- notifyAdmins_post.sh Triggered for any event that sends a message to all Admins. priority=# subject=subject line message=message body user=multiple email_only=0|1 (1 means it will only trigger an email in some cases when set, like BFM message suppression, without a Message System notice) You can get the list of admins from /usr/local/directadmin/data/admin/admin.list This does make a call to "sendSystemMessage", which also has a hook, if email_only=0. --- sendSystemMessage_pre.sh sendSystemMessage_post.sh same data is notifyAdmin_post.sh, but also: include_admins=0|1 - where 1 means the Admins will also be notified, but won't be in the "users" list variable. See the admins.list for the list of Admins. alternate_email=0|1 - usually 0, but some cases like BFM message supression means the user.conf alternate_email is used, so main inbox isn't flooded for common messages. This is always 1 for those cases, but only matters if the user.conf actually has alternate_email set. If it's not in the user.conf, it makes no difference. Refers to the emails used for notification of the message in the Message System. users=user0=fred&user1=george - where the value to the right of "users" is URL encoded (the example doesn't the encoding of & and =). It's possible this value is blank if include_admins=1.

Interested to try DirectAdmin? Get a 30-day Free Trial!