Skip to content

Behaviours

Standard behaviour

In the endpoint example in the configuration we are using the method: process_email(). The description of this method is as follows:

Processes an email data and fills the given unit of work with limeobjects to create and returns the unsaved helpdesk object.

  1. Tries to find an helpdesk by looking for helpdesknumber in the subject of the email If exists, use that helpdesk. If not, create a new one.
  2. Applies the following logic to connect person and/or company:

    • Person

      1. Match the sender's email address exactly. (If multiple matches, take the first)

    • Company

      1. If a person has been found using exact address matching as described above, use the company associated with that person.
      2. Unique match on the sender's full email address with the company email address.
      3. Unique match on the domain name in the sender's address (i.e. @lime.tech) with the company email address.
      4. Unique match on the domain name in the sender's address (i.e. lime.tech) with the domain name of the company's web site.
      5. Search for persons in the database having the same domain name (i.e. @lime.tech) in their email address as in the sender's address, if all matching persons are connected to a single company, use that company.

    This logic is controlled by the input parameter sender_id_behaviour which has the following value alternatives:

    • PersonEmailDomain (default) Will use behaviours a, b, c, d and e.
    • CompanyEmailWebsite Will use behaviours a, b, c and d.
    • CompanyEmailDomain Will use behaviours a, b and c.
    • CompanyEmailExact Will use behaviours a and b.
    • PersonEmailExact Will only use behaviour a.
  3. Creates a document for each non-inline attachment (configurable) in the email and attaches it to the helpdesk.

  4. Creates a history note about the received email in HTML-format and attaches it to the helpdesk by default, can be changed to Text (prefered for Desktop Client), or turned off.
  5. if save_email_as_file == True [Defaults to False] - Fetches and creates the email file as a document and attaches it to the helpdesk. (Required to be True for Desktop Client).

Info

It only attaches the found company and person to the helpdesk if it's new.

Otherwise it just attaches it to the history and documents

This is the standard behaviour and if that's enough for your customer you are all set with using the example.

Standard behaviour requirements

Info

The standard helpdesk behaviour requires the following data structure which mostly can be found in the LIP-packages of addon-helpdesk and addon-utility-helpdesk.

Below you can se the required datastructure for the standard behaviour, please note the ones not a part of any lip-package and thus needs to be added manually.

Helpdesk

Local Field Name Database Field Name Field Type Length Description
Subject subject Text 128
Ticket number helpdesknumber Text 32
Description description Text MAX
Subscription Email subscription_email Link field 256 Added manually, ReadOnly, Field label Email, Type Email Hidden everywhere
Email email Link/Text 256
Company company Relation (field) N/A
Person person Relation (field) N/A
History history Relation (tab) N/A
Documents document Relation (tab) N/A

Person

Local Field Name Database Field Name Field Type Length Description
Email email Link 100
Company company Relation (field) N/A
History history Relation (tab) N/A
Documents document Relation (tab) N/A
Helpdesk helpdesk Relation (tab) N/A

Company

Local Field Name Database Field Name Field Type Length Description
Persons person Relation (tab) N/A
History history Relation (tab) N/A
Documents document Relation (tab) N/A
Helpdesk helpdesk Relation (tab) N/A

History

Local Field Name Database Field Name Field Type Length Description
Date date Time N/A
Type type Option N/A See options here
Notes note Text MAX
msinbox_message_id msinbox_message_id Text 512 Added manually, ReadOnly, Hidden Everywhere
Helpdesk helpdesk Relation (field) N/A
Company company Relation (field) N/A
Person person Relation (field) N/A
Document document Relation (field) N/A
History Type options
Key En Sv Da Fi No
receivedemail Received email Fått e-post Modtaget e-mail Vastaanotettu sähköposti Mottatt e-post

Document

Local Field Name Database Field Name Field Type Length Description
Description comment Text 256
Document type type Option N/A See options here
Document document File N/A
Company company Relation (field) N/A
Person person Relation (field) N/A
Helpdesk helpdesk Relation (field) N/A
Document Type options
Key En Sv Da Fi No
other Other Övrigt Andet Muu Øvrig

Customized behaviour

The base class which always should be used to simplify working with lime-ms-inbox is EmailItem which parses a mail dictionary received from the MS Grap API into a more manageable class with support methods. Example:

import limepkg_ms_inbox.behaviours as inbox_behaviours

email_item = inbox_behaviours.EmailItem(email_data)

From that you will get all relevant properties with explanatory docstrings. If you for some reason need a property which wasn't deemed relevant you can get it using the method get_property().

Info

There are also a bunch of methods in the limepkg_ms_inbox.behaviours package that you SHOULD use to simplify your custom flows.

Contribute or just found flaws?

If you feel like some property or helper method is missing, or if you just have an idea of another flow for MS Inbox. Please share your thoughts in Github, by creating an issue