Metadata-Version: 2.1
Name: odoo-addon-mail_message_import
Version: 18.0.1.0.0.4
Requires-Python: >=3.10
Requires-Dist: odoo==18.0.*
Summary: Receive messages by several channels, identify their senders and group them in conversations
Home-page: https://github.com/OCA/social
License: AGPL-3
Author: Binhex, Odoo Community Association (OCA)
Author-email: support@odoo-community.org
Classifier: Programming Language :: Python
Classifier: Framework :: Odoo
Classifier: Framework :: Odoo :: 18.0
Classifier: License :: OSI Approved :: GNU Affero General Public License v3
Classifier: Development Status :: 4 - Beta
Description-Content-Type: text/x-rst

.. image:: https://odoo-community.org/readme-banner-image
   :target: https://odoo-community.org/get-involved?utm_source=readme
   :alt: Odoo Community Association

===================
Mail Message Import
===================

.. 
   !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
   !! This file is generated by oca-gen-addon-readme !!
   !! changes will be overwritten.                   !!
   !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
   !! source digest: sha256:24a76cc41292407eecc46c8233189368953a216bfe168dd8087dadbdd16aa591
   !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

.. |badge1| image:: https://img.shields.io/badge/maturity-Beta-yellow.png
    :target: https://odoo-community.org/page/development-status
    :alt: Beta
.. |badge2| image:: https://img.shields.io/badge/license-AGPL--3-blue.png
    :target: http://www.gnu.org/licenses/agpl-3.0-standalone.html
    :alt: License: AGPL-3
.. |badge3| image:: https://img.shields.io/badge/github-OCA%2Fsocial-lightgray.png?logo=github
    :target: https://github.com/OCA/social/tree/18.0/mail_message_import
    :alt: OCA/social
.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png
    :target: https://translation.odoo-community.org/projects/social-18-0/social-18-0-mail_message_import
    :alt: Translate me on Weblate
.. |badge5| image:: https://img.shields.io/badge/runboat-Try%20me-875A7B.png
    :target: https://runboat.odoo-community.org/builds?repo=OCA/social&target_branch=18.0
    :alt: Try me on Runboat

|badge1| |badge2| |badge3| |badge4| |badge5|

This module gives Odoo an inbox for the messages that the company
receives by several channels (email, WhatsApp...), whatever the channel:

- **Receiving channels**: the email addresses or phone numbers where the
  messages arrive. Each channel is a module (for example
  ``mail_message_import_email`` or ``mail_message_import_whatsapp``).
- **Senders** and their **authorized addresses**: the phones and email
  addresses allowed to send messages on behalf of each sender. A message
  from any other address waits in *Unknown senders* until a person
  assigns it to a sender, and the address can be authorized at the same
  time.
- **Conversations**: the consecutive messages of a sender are grouped
  and processed together once the sender has been silent for some
  minutes, so that clarifications and corrections are read in context.
  The conversations are queued, retried when they fail and reported as
  **incidents** when they keep failing.
- A **panel** with a card per receiving channel: unknown senders,
  incidents, conversations with errors or being processed, and the
  messages of the last days.

The module does not decide what a conversation means: other modules
process them (for example to turn the documents received into orders).
Without one, the conversations are just closed once grouped.

**Table of contents**

.. contents::
   :local:

Configuration
=============

1. Give the group *Message Import Manager* to the users that manage the
   application (the administrator has it after the installation).
2. Install the module of a channel (email, WhatsApp...) and create its
   receiving channel in *Message Import > Configuration > Receiving
   channels*.
3. In *Message Import > Configuration > Senders*, create the senders and
   the phones or email addresses they send from, in the tab *Phones and
   email addresses*.
4. In *Message Import > Configuration > Settings*, set the minutes
   without new messages before a conversation is processed, and the
   attempts before it is left in error.

Forwarded Outlook emails (``.msg``) are unpacked when the Python library
``extract-msg`` is installed; standard emails (``.eml``) need nothing
else.

Usage
=====

- *Message Import > Panel* shows a card per receiving channel with what
  is left to review.
- *Message Import > To review > Unknown senders* lists the messages of
  addresses that are not authorized. Select them and press **Assign to a
  sender**: the address can be authorized for the next messages, and the
  messages are processed as a conversation of the sender.
- *Message Import > Received > Conversations* lists the conversations. A
  conversation waiting for more messages can be processed at once with
  **Process now**, and one in error can be processed again with
  **Retry**.
- *Message Import > To review > Incidents* lists what could not be done,
  for example a conversation that failed every attempt. **Retry**
  processes it again once the cause is solved.

For developers, a channel module:

- adds its value to ``mail.message.import.channel.channel_type`` and
  tells the state of its channels in ``_channel_state()``;
- tells how its addresses are compared in
  ``mail.message.import.address._normalize_address()``;
- hands over each message with
  ``mail.message.import.message._receive_message()``.

A module that processes the conversations overrides
``mail.message.import.conversation._process_messages()``, which gets the
messages in chronological order, with their files downloaded and their
forwarded emails unpacked. Conversations are opened with SQL, not with
``create()``: a module that adds fields to them initializes those fields
in ``_on_open()``.

Bug Tracker
===========

Bugs are tracked on `GitHub Issues <https://github.com/OCA/social/issues>`_.
In case of trouble, please check there if your issue has already been reported.
If you spotted it first, help us to smash it by providing a detailed and welcomed
`feedback <https://github.com/OCA/social/issues/new?body=module:%20mail_message_import%0Aversion:%2018.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_.

Do not contact contributors directly about support or help with technical issues.

Credits
=======

Authors
-------

* Binhex

Contributors
------------

- `Binhex <https://binhex.cloud>`__:

  - Oliver García

Maintainers
-----------

This module is maintained by the OCA.

.. image:: https://odoo-community.org/logo.png
   :alt: Odoo Community Association
   :target: https://odoo-community.org

OCA, or the Odoo Community Association, is a nonprofit organization whose
mission is to support the collaborative development of Odoo features and
promote its widespread use.

.. |maintainer-oliverg09| image:: https://github.com/oliverg09.png?size=40px
    :target: https://github.com/oliverg09
    :alt: oliverg09

Current `maintainer <https://odoo-community.org/page/maintainer-role>`__:

|maintainer-oliverg09| 

This module is part of the `OCA/social <https://github.com/OCA/social/tree/18.0/mail_message_import>`_ project on GitHub.

You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.
