On this page, you’ll find some details on multiple options available to extend WATS functionnalities.
Plugins
WP Better Emails
With this plugin, the mail notifications will use an HTML template and have a very professional look.
Latest tickets widget
This plugin displays a list of most recent tickets in a sidebar widget.
Ticket ID Widget
With this plugin, you can add a sidebar widget to allow your users to jump to a ticket by ID.
Hooks
WordPress includes a very powerful hooking system to allow smooth code extension. This is the same for WATS! You can easily modify few parts of WATS thanks to the hooks. You can learn more about hooks on WordPress official site.
Notifications
All these hooks will allow you to completely customize the notifications sent out by WATS. The first hook is a filtering hook. It can be used to modify the content of the mail notification for ticket updates.
$output = apply_filters('wats_fire_ticket_update_notification_filter',$output,$postID);Then you also have one filtering hook for the mail subject.
$subject = apply_filters('wats_fire_ticket_update_notification_title_filter',$subject,$postID);You also have two filtering hooks available for the rule based notification.
$output = apply_filters('wats_fire_rules_notification_filter',$output,$postID); $subject = apply_filters('wats_fire_rules_notification_title_filter',$subject,$postID);Then, you have two filtering hooks for the new ticket notification for admins.
$output = apply_filters('wats_fire_admin_notification_filter',$output,$postID); $subject = apply_filters('wats_fire_admin_notification_title_filter',$subject,$postID);Saved ticket metas
This action hook is fired when ticket metas are saved (when a new ticket is submitted through the admin or an existing ticket is updated).
do_action('wats_ticket_saved_meta',$postID);A similar action hook is fired for new ticket submitted through the frontend submission form.
do_action('wats_ticket_frontend_submission_saved_meta',$post_ID);These hooks are useful if you want to perform a special action when ticket metas are saved (for instance, send a specific email if a specific value has been set).
Frontend submission form
This filter hook will allow you to tweak the frontend submission form.
$output_array = apply_filters('wats_ticket_submit_form_output_array',$output_array);The output_array contains the code associated to each section of the frontend submission form. You can unset those that you don’t need or modify the code. Here are the array keys : user_details, ticket_metas, category, ticket_title, ticket_description.
Ticket access denied
You have two filter hooks that you can use to tweak the message displayed when someone tries to access a ticket and the access is rejected. The first one is for unauthenticated users. By default, it will display the login form.
echo apply_filters('wats_filter_single_ticket_access_login_form',$output,$post);The second one is for logged in users if the access couldn’t be granted (usually because access is restricted to ticket author).
echo apply_filters('wats_filter_single_ticket_access_denied',$output,$post);Updates closed
This filter hook can be used to modify the message displayed when updates aren’t possible on a ticket. Updates are usually not possible when a ticket is closed or if the user has read only access.
echo apply_filters('wats_get_ticket_update_rights_message_filter', wats_get_ticket_update_rights_message());