Email copies of Peppol documents

What these emails are for

The module can automatically send an email for each Peppol document:

  • on sending -- when a customer invoice leaves for the access point;
  • on receiving -- when a supplier invoice arrives from the access point.

The XML file of the document is attached to each email. These copies are useful for instance to inform accounting, or to announce the arrival of a supplier invoice when you do not import it into Dolibarr yet.

These emails are meant for your team. To inform the customer that an invoice has been transmitted to them, use the Customer notification described in Configuration instead.

Enable the copies

In Home > Setup > Modules > Peppol, Settings tab, Automatic email sending section:

  1. Enable Send a copy by email when sending to Peppol and/or Send a copy by email when receiving from Peppol.
  2. Click Modify, then fill in Email address(es) for sent documents and Email address(es) for received documents. Several addresses are separated by semicolons: each address receives its own email.
  3. Click Save.

The email is sent from the general sender address of Dolibarr (Home > Setup > Emails, sender email for automatic emails). If it is empty, no copy is sent.

Customize the subject and the message

In the same section, after clicking Modify, four fields replace the default text:

Field Used for
Email subject for sent documents the subject of the copy on sending
Email message for sent documents the message of the copy on sending
Email subject for received documents the subject of the copy on receiving
Email message for received documents the message of the copy on receiving

A field left empty keeps the default text. You can therefore customize only the message of received documents, for example, and leave the rest unchanged.

The subject

It is a plain text on one line. The default text is shown greyed out in the field while it is empty.

The message

  • If the Dolibarr WYSIWYG editor module is enabled, the field shows a toolbar: bold, lists, and the link button to make an address clickable. Select the text, click the link button and paste the address.
  • Otherwise, the field is a plain text area. Line breaks are kept in the email. A web address written as plain text stays readable, and most email clients make it clickable on their own.

The XML file stays attached, whatever the message.

The variables

Written as they are in the subject or the message, these variables are replaced when the email is sent:

Variable Replaced by Sending Receiving
__REF__ the document reference: the one of the sent invoice (e.g. FA2611-0042), or the one of the import for a received document (e.g. PIM-0001) yes yes
__FILENAME__ the name of the attached XML file yes yes
__PEPPOL_SENDER_ID__ the Peppol identifier of the document sender no yes
__PEPPOL_RECEIVER_ID__ the Peppol identifier of the receiver, that is yours no yes
__MYCOMPANY_NAME__ the name of your company yes yes
__MYCOMPANY_EMAIL__, __MYCOMPANY_PHONE__, __MYCOMPANY_ADDRESS__, __MYCOMPANY_ZIP__, __MYCOMPANY_TOWN__ the contact details of your company yes yes

An unsupported variable stays written as it is in the email: check its spelling (two underscores on each side, in uppercase).

Examples

Supplier invoices downloaded from the access point website

You do not import supplier invoices into Dolibarr yet, but you want to be told when they arrive and where to find them.

Email subject for received documents:

New supplier invoice received through Peppol (__REF__)

Email message for received documents:

Hello,

A new document has arrived through the Peppol network, sent by __PEPPOL_SENDER_ID__.

You can download it from our access point website at this address:
https://example-access-point.com/received-documents

The XML file is attached to this email.

Replace the sample address with the one of your access point. With the WYSIWYG editor, make it clickable with the link button.

Copy for accounting on each sending

Email subject for sent documents:

[__MYCOMPANY_NAME__] Invoice __REF__ transmitted through Peppol

Email message for sent documents:

Hello,

Invoice __REF__ has just been transmitted to the customer through the Peppol network.
You will find the XML file (__FILENAME__) attached.

Default texts

When the fields are empty, the emails use these texts. They are translated into the language of the user who triggers the sending or the download, or into the default language of Dolibarr when the scheduled task does the work.

Sending Receiving
Subject [Peppol] Document sent: <reference> [Peppol] Document received: <reference>
Message The document <reference> has been successfully sent to the Peppol network. You will find the XML file attached. A new document has been received from the Peppol network. You will find the XML file attached.

Good to know

  • One language: the custom text is the same for all addresses. If your recipients do not share a language, write the message in several languages one after the other.
  • When the copy is sent on receiving: the copy leaves when the module downloads the documents from the access point, that is when the scheduled task runs or when you click Refresh in Billing > Peppol Import.
  • Tracking: each copy sent creates an event "Email copy sent to ..." on the invoice or on the import. On failure, the event "Error sending email copy" gives the address concerned and the reason.
  • Acube access point: to date, no copy is sent on receiving with this access point. The copy on sending works.