============== Tickets plugin ============== The Fleio tickets plugin adds a ticketing system, support departments and configurable signatures for staff users. Tickets can be created from the Fleio interface or automatically generated when a department receives a message on its related email. Staff can configure email notifications for ticket actions (open/close/reply) based on the associated department. This documentation includes: .. contents:: :local: .. _tickets-main: Enduser panel ============= .. _enduser-create-ticket: Create ticket ------------------------ Enduser can add a new ticket by clicking the ``Add ticket`` button from the bottom right side of the tickets page. .. image:: /_static/images/plugins/tickets/add-button.png After clicking the button the following form will need to be submitted to create the ticket. .. image:: /_static/images/plugins/tickets/enduser-ticket-form-angular.png As you can see, the end-user needs to fill in some basic details. He also needs to select a department (departments can be created in staff panel), can add CC recipients (they may receive email notifications about the ticket), and can associate a service with the ticket or may add attachment files. .. _enduser-reply-manage-ticket: Replying and managing the ticket ----------------------------------------- A typical conversation from the enduser perspective may look like this: .. image:: /_static/images/plugins/tickets/ticket-conversation-angular.png As you can see, everyone can add replies, the enduser may close the ticket by pressing the ``close ticket`` button. Messages with attachments will have it added at the bottom of the box and clicking it will trigger a dropdown where users can choose to either open the attachment in a new tab or download it. .. _enduser-ticket-list-page: Tickets list page -------------------------- .. image:: /_static/images/plugins/tickets/enduser-tickets-list-angular.png In the end user panel, you will be able to see all the tickets that are assigned to you. You can also filter the tickets / change the display (list view or card view) using the action buttons from the above image. Available filters for enduser panel: * **Created at** * **Status** * **Department** You can order the tickets by: * **Last reply** * **Created at** * **Status** * **Title** * **Department** Staff panel =========== .. _staff-create-ticket: Create ticket ------------------------ As it was for enduser, if you want to create a new ticket, you will have to press the "+" button in the top bottom corner. .. image:: /_static/images/plugins/tickets/staff-ticket-form-angular.png Note that the staff can also insert predefined replies. .. _staff-tickets-list-page: Tickets list page ------------------------ .. image:: /_static/images/plugins/tickets/staff-tickets-list-angular.png The page where tickets are listed in the staff panel automatically filters the tickets that: do not have the internal status set to done, are assigned to the logged in user and those that have no assignee. You can change the ordering/filtering of the tickets using the action buttons from the above image. Available filters to user are: * **Assigned to**: *Filter tickets by their assigned user* * **Created at**: *Filter tickets by their creation date* * **Internal status**: *Filter tickets by internal status* * **Status**: *Filter tickets by their status* * **Priority**: *Filter tickets by their priority (high/medium/low)* * **Client**: *Filter tickets by their associated client* * **Department**: *Filter tickets by their associated department* You can also order the items by: assigned to, created at, created by, internal stats/status, title, department or priority and can also display the tickets as cards or as a list (table). .. _staff-reply-manage-ticket: Replying and managing the ticket --------------------------------------- Same as for the :ref:`enduser-reply-manage-ticket`, though the staff can also: * **Add notes**: a new tab just like the activity tab is available, just for adding notes * **Link tickets**: staff can link tickets between them (add links using the button from the ``quick actions`` dropdown on top-right side of a ticket) * **Edit/delete comments and attachments**: staff users can manage all comments and attachments for tickets. A small note will be added at the bottom of the message for staff users to see when was the last edit done and by whom .. _ticket-updates: Ticket updates ============== When a certain action is taken on the ticket, updates appear between messages. .. image:: /_static/images/plugins/tickets/status-updates.png They appear on ticket status updates, when changing assignee, associated client, changing description, etc.. (though some of the updates are not available for endusers). .. _ticket-attachments: Ticket attachments ================== You may want to change a few settings regarded to attachments. You can edit/set these variables in the ``settings.py`` file: * ``ATTACHMENTS_DIR``: *directory where attachments will be saved* * ``MAX_TICKET_ATTACHMENT_SIZE``: *the maximum file size (in bytes) allowed to be uploaded for ticket attachments* * ``FREE_DISK_SPACE_LIMIT``: *ticket attachments upload won't be allowed if the free space left on device (in bytes) will be smaller than this setting after upload* Default values for these are: .. code-block:: python ATTACHMENTS_DIR = '/var/fleio/attachments' MAX_TICKET_ATTACHMENT_SIZE = 26214400 # 25MB FREE_DISK_SPACE_LIMIT = 52428800 # 50MB .. _ticket-generation: Ticket generation from emails ============================= After you set up the departments in fleio and configure the mail server so that incoming emails will be sent through the ``incoming_mail.py`` script, tickets will be automatically generated in fleio when one of those mail servers will receive a message. The ticket will associate the department, the user that creates the ticket (if a user with the sender email address exists in fleio) and its related client with the ticket. Ticket replies are also added when someone sends an email having the ticket ID in the subject field of the email (though the sender needs to be related somehow to the existing ticket, or be a staff user in fleio). .. _user-signatures: User signatures =============== Staff users can manage signatures based on department. Those can be added/edited going to the ``My profile`` page and clicking on ``Edit signatures`` button. The user is requested to add a global signature first then he can add custom signatures for each department. After saving signatures, the textarea from ticket details page that is used for replying to tickets will always be prepopulated with either the global signature if the ticket has a department for which the user did not configure a custom signature or the signature associated with that certain department. .. image:: /_static/images/plugins/tickets/user-signatures.png .. _ticket-notifications: Ticket notifications ==================== You can enable/disable notifications when editing the department (more on that below). You can also edit these notification templates in the :doc:`staff notification templates ` page. .. _configurable-ticket-id: Configure ticket id =================== You can configure ticket id based on each department. When editing a department (more on that below) you can edit the ticket id format. Each ticket that is created and related to that specific department will have an id generated using that format. The format supports the following keys: * ``%Y`` (will display the year, eg. 2019) * ``%y`` (will display last 2 digits from year, eg. 19) * ``%M`` (will display month, eg. 06) * ``%D`` (will display day, eg. 05), * ``%h`` (will display hour, eg. 12) * ``%m`` (will display minute) * ``%L`` (will transform into a random uppercase letter) * ``%l`` (will transform into a random lowercase letter) * ``%n`` (will transform into a random number between 0 and 9). Besides these, you can use regular characters, prefixes, etc. Some ticket id formats may look like these: 'T-%n%n%n%n%n%n', 'BILLING-%Y-%M-%l%l%l%l%l%l'. You are required to use at least 6 key values that will generate random letters/numbers. However you can change this requirement by editing the ``TICKET_ID_MIN_RANDOM_CHARS`` setting in your :doc:`advanced settings file `, however we recommend using at least 6. If the ID cannot be generated using the format defined on the department (very unlikely if you follow the standard minimum of random keys) it will use the fallback ``TICKET_ID_DEFAULT_FORMAT`` setting that you can change in the same :doc:`advanced settings file `. This default format is composed of 6 random numbers. .. _departments-main: Departments =========== .. _departments-list: Departments list page --------------------- The departments page lists your application tickets departments. Departments can be filtered, ordered or you can switch their display (card view/list view) using the action controls in the top right side of the screen. .. image:: /_static/images/plugins/tickets/departments-list.png Hovering over a card will show the edit and delete action buttons related to that specific department. .. _departments-create-edit-manage: Departments create/edit and manage notifications ------------------------------------------------ You can add a new department clicking the (+) button from the bottom right side of the screen: .. image:: /_static/images/plugins/tickets/add-button.png A form like in the following image will be shown. .. image:: /_static/images/plugins/tickets/department-form-angular.png As you can see, basic info about the department needs to be set (name and email). Make sure the email you'll set is configured to receive emails through the ``/var/webapps/fleio/scripts/incoming_pipe`` script, otherwise when an email is sent to that address, a ticket won't be opened in fleio. If you have a local mail server you need to add a line like this in your ``/etc/aliases`` file: .. code-block:: bash support: | /var/webapps/fleio/scripts/incoming_pipe Assuming email to ``support@yourdomain.com`` is routed to the local machine, the above pipe will send messages received on this address to Fleio tickets system. Ticket id format will allow you to change the id format of each ticket created and related to the specific department. More on that here: :ref:`configurable-ticket-id`. The checkboxes listed underneath the input fields will let you configure which kind of notifications to send and to whom. Each ticket will have the associated department notifications configuration. .. _predefined-replies: Predefined replies ================== Predefined reply category ------------------------- In order to create predefined replies you will have to create categories. To create a new category, press the "+" sign at the bottom-right corner. .. image:: /_static/images/plugins/tickets/predefined-reply-category-angular.png Predefined reply ---------------- To create a new predefined reply, you will have to access a category, and then press the "Add new predefined reply" button. .. image:: /_static/images/plugins/tickets/predefined-reply-form-angular.png A predefined reply can be inserted when creating a new ticket, or when adding a reply to the ticket, by clicking the "Insert predefined reply" button.. .. note:: The predefined replies are available only to staff. .. _docker-tickets: Email routing ============= When using the Docker deployment method, you will have to do some extra configurations to your mail server, to allow routing of emails from local mail server, to the Docker container. First, we will need to impersonate the fleio user and to create a new aliases file, in the /home/fleio/ directory: .. code-block:: bash cd /home/fleio && touch .aliases Now, we need to add the following line, so we can pipe the emails to the Docker incoming mail container: .. code-block:: bash vi /home/fleio/.aliases support: | "docker exec -i fleio-incomingmail-1 /var/webapps/fleio/scripts/incoming_pipe" Save and exit vi. Generate the aliases database, and apply proper permissions: .. code-block:: bash postalias /home/fleio/.aliases chown fleio:fleio /home/fleio/.aliases chown fleio:fleio /home/fleio/.aliases.db Next step is to edit the postfix configuration: .. code-block:: bash vi /etc/postfix/main.cf On the ``alias_maps`` line, we need to add the new alias file: .. code-block:: bash alias_maps = hash:/etc/aliases, hash:/home/fleio/.aliases Finally, you need to allow unauthenticated mails from the Docker container, to be sent via the local mail server. In the same postfix configuration file, you need to add these two IP classes, on the ``mynetwork`` line: mynetworks = 127.0.0.0/8 [::ffff:127.0.0.0]/104 [::1]/128 192.168.0.0/16 172.16.0.0/12 Notice that the 192.168.0.0/16 and 172.16.0.0/12 are the classes that we added. Both are used by Docker and both need to be allowed so you can send emails from Docker containers. If you want to be more restrictive to the IPs that are allowed to send unauthenticated mail, you can run the following command to get the IP list of the Docker container, that you need to add it in my networks: .. code-block:: bash for f in `fleio status | grep fleio | awk '{print $1}'`;do \ docker inspect -f '{{range.NetworkSettings.Networks}}{{.IPAddress}}{{end}}' $f; done This will output a list of IPs, like in this example: .. code-block:: bash 172.20.0.9 172.20.0.7 172.20.0.8 172.20.0.2 172.20.0.6 172.20.0.4 172.20.0.3 172.20.0.5 172.20.0.10 Note that in the Postfix configuration, in the ``mynetworks``, you need to add the class, so if you want to add only the IPs that are used, you need to add a /32 at the end of the ip (172.20.0.9/32). Restart postfix: .. code-block:: bash systemctl restart postfix