meta data for this page
Differences
This shows you the differences between two versions of the page.
| Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
| ticket_email_parse [2023/07/07 22:33] – johnny | ticket_email_parse [2026/02/09 15:59] (current) – Added config details for OAuth 79.173.147.104 | ||
|---|---|---|---|
| Line 1: | Line 1: | ||
| ====== Email ticketing ====== | ====== Email ticketing ====== | ||
| - | Client contacts | + | Clients |
| - | 1. Install PHP extensions: (These will be installed if you installed script method) | + | 1. Install PHP extensions: (//These will be installed if you installed |
| * php-imap | * php-imap | ||
| * php-mailparse | * php-mailparse | ||
| Line 14: | Line 14: | ||
| * IMAP Password | * IMAP Password | ||
| - | 3. Turn on: Settings > Ticket > Email-to-ticket parsing | + | 3. Turn on: Settings > Ticket > **Email-to-ticket parsing** |
| - | 4. Add a cron job to run //email_parser_cron.php// every minute | + | 4. Add a cron job to run //cron_ticket_email_parser.php// every minute |
| - | 5. Ensure that all clients have the correct ' | + | 5. Decide whether you wish to automatically create tickets |
| + | - Ensure that all clients have the correct ' | ||
| + | |||
| + | - Enable Admin > Ticket > "// | ||
| + | |||
| + | ====== How it works ====== | ||
| + | - Cron runs cron_ticket_email_parser.php | ||
| + | - The email inbox is checked for unread messages | ||
| + | - If an unread message is found, it's marked as read & checked for a ticket reference in the subject ((e.g. [TCK-091]) | ||
| + | - If there is a ticket reference | ||
| + | - The ticket info is fetched & checked to be open | ||
| + | - If the ticket is open, the reply is added | ||
| + | - If the ticket is closed, an auto response is sent and a notification raised | ||
| + | - If there isn't a ticket reference - it's treated as a new message | ||
| + | - We check for an existing contact (based on the email) and raise the ticket under them | ||
| + | - If there' | ||
| + | - If so, we create a new contact under that client for the user and raise the ticket under them | ||
| + | - If not, we leave the email in the inbox to be actioned manually (or if the //unknown senders// setting is enabled we create the ticket with no contact/ | ||
| + | - If the email was successfully processed (e.g. a ticket raised / reply added), the message is moved to the ITFlow folder once attachments are processed | ||
| ===== Notes ===== | ===== Notes ===== | ||
| - | * Only supports **basic auth**entication. This will not work with Microsoft as they require OAuth. | ||
| - | * The IMAP connection uses the same SMTP Username/ | ||
| * As closed tickets cannot be re-opened, replies to closed tickets raise a notification | * As closed tickets cannot be re-opened, replies to closed tickets raise a notification | ||
| - | * Emails | + | * By default, emails |
| + | * This behaviour can be adjusted by enabling "// | ||
| + | |||
| + | |||
| + | ===== Microsoft 365 & Google OAuth Support===== | ||
| + | As of IT Flow version 26.02 OAuth support has been added. Setup for this is very simple. The guide below will focus on Office 365. | ||
| + | |||
| + | ==IT Flow Initial Configuration== | ||
| + | 1. Open Administration > Settings > Mail | ||
| + | |||
| + | 2. Select SMTP Provider as Microsoft 365 (OAuth) or Google Workspace (OAuth). | ||
| + | Note that there are no settings to configure under SMTP, these are inherited from your IMAP settings entered in the next step. | ||
| + | |||
| + | 3. In 'IMAP Provider' | ||
| + | |||
| + | 4. In 'IMAP Username' | ||
| + | |||
| + | |||
| + | ==Microsoft Entra ID Configutation== | ||
| + | 1. Open up Entra and go to App Registrations > All Applications or [[https:// | ||
| + | |||
| + | 2. Create a new app by slecting New Registration | ||
| + | |||
| + | 3. The name can be anything you want, but i suggest using IT Flow. Set the ' | ||
| + | |||
| + | 4. Go to 'API Permissions' | ||
| + | * IMAP.AccessAsUser.All | ||
| + | * offline_access | ||
| + | * openid | ||
| + | * profile | ||
| + | * SMTP.Send | ||
| + | * User.Read | ||
| + | |||
| + | 5. When these are added, **do not forget** to click the 'Grant Admin Consent for {{Your Organisation}}' | ||
| + | |||
| + | 6. Next, go to ' | ||
| + | |||
| + | 7. Go to ' | ||
| + | |||
| + | 8. We need 2 more things, so lets go back to the Overview page and copy your ' | ||
| + | |||
| + | |||
| + | ==IT Flow Final Configuration== | ||
| + | 1. Back in IT Flow, paste the ' | ||
| + | |||
| + | 2. Paste the ' | ||
| + | |||
| + | 3. Paste the ' | ||
| + | |||
| + | 4. Hit the ' | ||
| + | |||
| + | 5. In the ' | ||
| + | |||
| + | 6. Sign-in to Microsoft 365 with the account you will be monitoring for new tickets | ||
| + | |||
| + | 7. Select the ' | ||
| + | |||
| + | 8. You should now be taken back to IT Flow and your ' | ||
| + | |||
| + | 9 Hit save one final time. | ||
| + | |||
| + | |||
| + | ==Verification== | ||
| + | 1. Scroll to the bottom of the settings page and test email sending, test the IMAP connection and finally test the OAuth token refresh. If all work, then go ahead and send an email to your mailbox and check if this is picked up and converted to a ticket. The mailbox is checked every 60 seconds. | ||