The Case - Email Gateway

Introduction

The email gateway allows your users to not do anything special within the Tiny ERP client. They can create, assign or update cases by simply sending or receiving mails with their usual mail client (outlook, thunderbird, evolution, ...).

The following schema represent the gateway action:

To better undertand the email gateway, lets imagine the following situation:

Example of usage:

And all these steps are made automatically by the mail wateway without using the Tiny ERP Client. So, this implied no effort from the user or the partner.

And, as everything is recorded in Tiny ERP, the user can go in the interface to perform powerfull actions:

And the manager get all statistics he needs to improve their support process:

Sending Commands to Tiny ERP by email

You can also send commands to Tiny ERP by email about a defined case. Only the user responsible of the case can do this.

To do this, write your commands in the first lines of the message. Your commands must be on the form:

 Set-[ACTION] : [VALUE]

Where action define what you plan to modify and value the new value. Allowed actions and value are:

For example, if you reply to the following message, you will set Emmanuel (ede) as the new responsible and set the case as Pending because you are waiting for the confirmation of the partner.

 Set-User: ede
 Set-State : pending

 Hello Emmanuel,
 Here is a case you should take into account.
 Fabien

Automatic States

When a partner send an email about a case, this case is automatically set to:

When the user replies to the partner, the case is set to close. (unless specified with Set-State: pending).

To be sure Tiny ERP will detect the associated case to a mail, do not remove the ID wich is between brackets in the subject. This ID is automatically added by the mail gate when forwarding customers emails.

Example for a support section

The following picture is an example of a support section using this system. In addition to the normal interactions by email, the user can go to the Tiny ERP interface and process a series of actions at any level:

If a Tiny ERP user send a mail to a partner, the state is set as close or pending, depending on your configuration. You can also create a rule to change this.

Fault Tolerant

The eMAil gateway is fault tolerant for different reasons

Installation

To benefit from the gateway usage, you have to install it. There is different methods available, depending on your mail server. We will describe here a generic and simple method using the fetchmail program.

First you have to create an email address (POP3 or IMAP) for each section you plan to interface. Let's say you created the address 'support@mycompany.com' with the following details:

Then you have to choose a Tiny ERP user that will be used by the gateway to access the Tiny ERP server. Let's say you will use this one:

To get the ID of the user, open his form using the menu: Administration > Users > Users. Then note this Id written at the bottom of the screen.

Finally, you need a case section that is created in Tiny ERP using this menu: CRM & SRM > Definitions > Cases > Sections. Use the ID (better) of the case or his code. Let's say we will define the section with the code 'SSUP'.

After that, you must install fetchmail on the same machine of the Tiny ERP server. You wan download this program through this website: http://fetchmail.berlios.de/ Then write a file named fetchmailrc that contains the following rules:

 # fetchmailrc

 poll pop.mycompany.com proto pop3:
 username support password mypass mda "/path/to/terpmg/tinyerp-mailgate.py -u3 -padmin -ssupport -esupport@mycompany.com"

And run fetchmail:

 fetchmail -f fetchmailrc

When trying to run fetchmail for the first time, add -v to get all logging messages.

Each time you run fetchmail, it will download requests, dispatch them and update the case in Tiny ERP. You can run fetchmail in background so that it check mails every 5 minutes using the -d 300 attribute. If you do not like the 5 minute delay, consider integrating the tinyerp-mailgate program directly with your mail server.

If you want to receive requests by email, do not forget to create a rule that assign incoming messages to a given user and verify that this user as an email address in Tiny ERP (through the address field).

You must also ensure that a mail server able to send emails is configured in your server.