Suspension notifications for manual suspension (SKINS)

Version 1.61.4


Previously, only the automated suspensions would send a notice for bandwidth over-usage. Manual suspensions would not send any notice, as it would be triggered by the creator. This new feature will provide a method to send a notice to the Message System (thus E-Mail) as to why they've been manually suspended. Features will include: - a new page to allow management of the default message to use. - Inclusion of a |REASON| token that can be used in this message - Ability to use if-then-else syntax on this |REASON| to control full sentences based on it's value. - Default option to send this message upon manual suspension or not. With the Evolution skin, upon suspension intent, a new modal pop-up will offer the choice of the reason (as before), but will also include the choice if the message should be sent or not. This modal will also include the full default subject and message, which can either be left as-is or altered for this one message delivery (without affecting the default). The creator of the account will also get a duplicate. Note that if an Admin suspends the User, but that Admin did not create the account, the Reseller that did create the account will get a copy of the email. Enhanced will rely on the default page for the message and delivery choice. ------------------------------------------------ TOKENS When saving a message, the following tokens are available. Note that the message is tokenized first, allowing you to set tokens which are passed to the subject (if ever needed) USERNAME: account being suspended USERTYPE: type of account being suspended: user|reseller|admin (useful mainly only for message overrides, see SUSPENSION below). CREATOR: creator of this User, even if the account doing the suspension is not the creator. EMAIL: email address of the User, from the user.conf (may differ from the User's message system email). DOMAIN: main domain of the User (user.conf), may be blank if they have 0 domains. HOSTNAME: hostname of the server. REASON: reason for the suspension passed. If no reason is passed, will be set to "none" REASON_STR: Human text from the data/templates/suspension_reason.txt or data/templates/custom/suspension_reason.txt). May be blank if REASON is not in there. MSG_FOOTER: recommended to leave as last text in the message. Standard footer is added. You can use the standard if-then-else syntax on any of the tokens, and even set your own tokens if needed. eg: |*if REASON="spam"| You sir, are a spammer. |*else| You were suspended. Reason: |REASON| |*endif| ==================================================================== ==================================================================== API ================================== VIEW MESSAGE / SETTINGS View the current settings: CMD_SUSPENSION_MESSAGE?level=1 View the current message for the User. level=1 User suspensions. 2, 3, are for Reseller, Admins. Add &json=yes for the subject, message, and "settings['notify'] == 'yes'|'no'" ================================== SAVE MESSAGE / SETTINGS CMD_SUSPENSION_MESSAGE method: POST save=<any text> level=1|2|3 (Resellers can only use 1) subject=Subject text message=message text notify=yes|no (checkbox, so not passed is 'no') ================================== RESET MESSAGE / SETTINGS To undo whatever you've done for this given level, pass: CMD_SUSPENSION_MESSAGE method: POST reset=<anytext> level=1|2|3 and that level will be deleted. ================================== SUSPENSION The usual suspension is still the same, but extra optional values can be passed. Without adding the extra values during suspension, if "notify=yes" was set in the settings, the message will be sent. The only way to override this would be to pass "notify=no' along with the suspension request, eg: CMD_SELECT_USERS method: POST dosuspend=<anytext> (reason=<suspend reason>) select0=fred (select1=george) OVERRIDES / optional: notify=yes|no subject=subject text message=message text where all 3 options extras are optional. You do not need to pass all 3.. can be any of them, or all of them, or 2, etc.. The subject/message texts are still tokenized normally. The reason is optional, but we highly recommend setting it if a message is to be sent out. Without a reason, it will be set to "none", which may cause confusion. Keep in mind, that the Admin Level -> Show All Users page can suspend all 3 types of accounts in 1 request. if the subject/message is passed along with the suspension, this will not be type-specific. In that case, you can use the |USERTYPE| token to do some if-then-else statements in the message ==================================================================== FILES The files saved on disk will be at: /usr/local/directadmin/data/users/creator/u_suspension.json /usr/local/directadmin/data/users/creator/r_suspension.json /usr/local/directadmin/data/users/creator/a_suspension.json ==================================================================== TEMPLATE Unlike other email notices, we've opted to not use a default template for this tool. Instead, it makes use of the internal "gettext" .pot lang files for easier translation. ==================================================================== SKINS /usr/local/directadmin/data/skins/enhanced/reseller/edit_message.conf The edit_message.conf file already existed for editing the welcome messages, but it was re-used with if-then-else to accommodate the new feature. There were no changes to files_reseller.conf to point to it. ---- EVO1938

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