Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open tickets by email #43

Closed
marien-probesys opened this issue Sep 28, 2022 · 1 comment
Closed

Open tickets by email #43

marien-probesys opened this issue Sep 28, 2022 · 1 comment
Assignees
Labels
topic: emails All the stuff related to the emails system topic: ticketing All the stuff related to the tickets type: new Global features that aren't there yet

Comments

@marien-probesys
Copy link
Member

marien-probesys commented Sep 28, 2022

Depends on #17 and #331

Estimated time: 2 days

User story

As a requester,
I want to open a ticket by email,
so I can explain and be helped with a problem that I encounter directly from my email client.

Overview

We’ll only consider the creation of tickets for now.
It means that all emails collected by the Collector will create a new ticket.
This is obviously temporary, before #36 is implemented.

Once the MailboxEmail is saved (see #331):

  1. get the sender email (From header, or Reply-To if it exists)
  2. check that the address corresponds to a User (and mark the MailboxEmail as failing if it doesn't exist)
  3. check the user is assigned to a default organization and that he has the permission to create tickets in it (and mark the MailboxEmail as failing if he can't)
  4. extract the title and the content from the email, and create a ticket
  5. mark the MailboxEmail as processed

Technical aspects

Extract the content

As a first approach, the content of the email will be done as following:

  1. get the HTML body and sanitize it with the app HtmlSanitizer
  2. if it doesn't exist, get the text body, escape the potential HTML tags and transform new lines in <br>

We we’ll not clean the content to remove eventual answers in the content yet.

Handle errors

We’ll need the new last_error and last_error_at fields in MailboxEmail in order to save the potential error and display them in the administration.

Later, the admins could be notified about these errors.

Process a MailboxEmail

Once finished, the MailboxEmail can be linked to the created ticket.
This will allow a better tracking of the tickets.
Later, the processed MailboxEmails (i.e. the ones with a related ticket_id) will be cleaned by a scheduled task after a certain time to be determined (related to the last paragraph of #331).

I’ve decided to simply delete the MailboxEmail for now.

Anonymous creation

We’ll consider allowing any email address to open tickets later.
This is out of scope of the current specification.
See #374
Related to #294

@marien-probesys
Copy link
Member Author

marien-probesys commented Jun 21, 2023

What's remaining:

  • requester is not retrieved from the "Reply-To" header
  • the MailboxEmail is deleted right after the creation of the ticket (it makes difficult to debug a bad import, e.g. content badly sanitized) will not do until it becomes really useful
  • we could consider to get the content in priority from the text body instead of HTML I wonder if the text body is always equivalent to the HTML body, so for now I prefer to give priority to the HTML content

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
topic: emails All the stuff related to the emails system topic: ticketing All the stuff related to the tickets type: new Global features that aren't there yet
Projects
None yet
Development

No branches or pull requests

1 participant