Module Auto Reminder: Difference between revisions

(Traduction en anglais)
Tag: 2017 source edit
No edit summary
Tag: 2017 source edit
 
(12 intermediate revisions by the same user not shown)
Line 1: Line 1:
{{DISPLAYTITLE:Auto Reminder module by Stéphane Mallet Informatique}}
<!-- BEGIN interlang links -->
[[fr:Module_Auto_Reminder_FR]]
<!-- END interlang links -->
 
[[Category:Complementary modules]]
[[Category:Complementary modules]]
[[Category:Modules complémentaires]]
{{TemplateDocUser}}
 
=Information=
=Information=
{{TemplateModuleInfo
{{TemplateModuleInfo
Line 8: Line 10:
|editor=Stéphane Mallet Informatique
|editor=Stéphane Mallet Informatique
|web=https://web-pilot.fr/offres/rsi
|web=https://web-pilot.fr/offres/rsi
|webbuy=https://www.dolistore.com/product.php?id=2770
|status=stable
|status=stable
|prerequisites=Dolibarr 19 minimum - PHP 7.1 minimum - Scheduled jobs module enabled
|prerequisites=Dolibarr 19 or higher
|webbuy=https://www.dolistore.com/product.php?id=2770&l=en
|note=Tested on Dolibarr 24. Free module, GPLv3.
|note=Free module, GPLv3 license. Source code and zip: https://framagit.org/Steph501/dolibarr-mod-autoreminder
}}
}}


'''Short description:''' Automatically sends invoices as soon as they are validated, and reminds unpaid invoices through configurable levels. One module, two automations, a single daily scheduled job.
'''Auto Reminder''' automatically sends and follows up invoices and commercial proposals in Dolibarr. Everything is driven by a daily scheduled job.


=Features=
= Features =


==Automatic sending of validated invoices==
== Invoices ==
* Every validated invoice is emailed without any action, with its PDF attached.
* The email template is picked among the existing Dolibarr templates.
* Each invoice is sent only once: the module keeps track of it in the agenda.
* The recipient is resolved automatically: billing contact, then third party contact, then third party email.


==Reminders for unpaid invoices==
* Automatic sending of validated invoices by email, with the invoice PDF attached and a configurable email template.
* Reminders rely on levels you define: a delay in days and an email template for each level.
* Automatic reminders for unpaid invoices, based on configurable levels. Each level defines a delay in days relative to the due date (or the invoice date if no due date) and an email template. Negative delays are allowed (preventive reminder before the due date).
* Any number of levels.
* A negative delay sends the reminder '''before''' the due date, as a preventive notice.
* Option to include or exclude partially paid invoices.
* Option to include or exclude partially paid invoices.
* An invoice is never reminded twice for the same level.
* The delay is counted from the due date, or from the invoice date when no due date is set.


==Excluding a customer or an invoice from reminders==
== Proposals (since 1.3.0) ==
* An "Exclude from automatic reminders" checkbox is added on the '''third party card''': this customer receives no reminder at all, while every other customer keeps being reminded.
 
* The same checkbox is added on the '''invoice card''': useful for a disputed invoice or a negotiated payment schedule, without stopping the reminders of the other invoices of that customer.
* Automatic sending of validated proposals by email, with the proposal PDF attached.
* These exclusions only apply to reminders. The initial invoice sending is not affected.
* Automatic reminders for proposals still unanswered (not signed, not refused, not billed). Levels are counted from the end of validity date of the proposal (or its date if none).
* Settings are fully separate from invoices: the module setup page has one tab for invoices and one tab for proposals, each with its own switches, email template and reminder levels.
 
== Only the highest level reached is sent ==
 
For each document, only the highest reminder level reached is considered. Lower levels that were missed are never sent afterwards: a document already overdue when the module is enabled receives a single reminder, the one matching its actual delay, with the right template. Never a burst of reminders over several days.
 
== Semi-automatic mode (since 1.3.7) ==
 
Instead of sending a reminder, the module can prepare it and let you send it yourself. Each reminder due becomes an alert:
* a bell in the top bar shows how many invoices and proposals are to be reminded, and leads to them;
* the invoice and proposal lists get a ''Reminder'' column and a ''To remind'' filter;
* the card of the document shows the alert with a ''Remind'' button, which opens the native Dolibarr send form, prefilled with the template of the level in the language of the customer, and with the recipients of the module.
 
The alert closes when an email is sent from the card or scheduled with Doli Mail Later, when a higher level replaces it, or when you cancel it: only this level is then skipped. The mode is set per document type in the settings (''Semi-automatic mode by default''), and can be changed per third party and per document with the "Reminders" field.
 
== Reminders per third party and per document (since 1.3.7) ==
 
The "Reminders" field is available on the third party card, the invoice card, the template invoice and the proposal card:
* '''Automatic''': the reminder goes out on its own;
* '''Semi-automatic''': the module prepares the reminder and flags it to you;
* '''None''': the reminder is neither sent nor prepared as an alert, and an alert already open disappears.
 
Left empty, the next level decides: the setting chosen on the invoice or the proposal takes precedence over that of the third party, which takes precedence over the module settings. Example: a third party in dispute is set to "None", one of its invoices to "Automatic": only that invoice is reminded. An invoice generated from a template invoice receives the setting of the template, which can then be changed on the invoice.
 
The initial sending of documents is not affected by this field. It replaces the "Exclude from automatic reminders" checkbox of previous versions (see Installation for the upgrade).
 
== Recipient of the emails ==
 
The recipient is determined in this order, for sending and for reminders:
 
# The contact attached to the document (Contacts tab of the invoice or proposal), whatever its role. If several contacts are attached: billing then service then shipping for an invoice; follow-up then billing then shipping for a proposal.
# Otherwise the default contact of the third party for this document type (Contacts/Addresses tab of the third party).
# Otherwise the first active contact of the third party having an email.
# Otherwise the email address of the third party.
 
Since 1.3.1, every contact sharing the highest priority role is kept, not only the first one: two or three billing contacts attached to the same invoice all receive the email, in a single sending. The priority order is unchanged, so a billing contact still wins over a shipping one. Steps 1 and 2 above work this way; step 3 keeps a single recipient, since without a role nothing tells who handles the invoices.
 
Disabled contacts and contacts without email are never used. If no recipient is found, nothing is sent and an event is recorded in the document agenda.
 
== Language of the emails (since 1.3.2) ==
 
An email goes out in the language of the third party, else in the default language of emails chosen in the module settings (since 1.3.7), else in the language of your Dolibarr. The module takes the first of these languages in which the email template exists, and sends the template of the settings as it is when none has it. The language fallback (es_MX to es_ES, then a template with no language) is the native Dolibarr one. Dates and amounts follow the language of the email sent. The attached PDF is not regenerated: it is the document as it stands.
 
Example: in a French Dolibarr with English as default language of emails, a third party without language receives English, a French third party French, and a German third party English when there is no German template.
 
Translating a template is done in Dolibarr itself, not in the module settings: create the template again with the SAME label, choose the language, then translate the subject and the content. Note that the language of third parties and templates only appears when the Dolibarr multi-language option is enabled.
 
== Safety against mass sending ==
 
Only documents validated after the sending option was enabled are sent: enabling the module on an existing database never sends the historical documents. The reference date is stored when you enable the option, displayed in the settings, and editable: you can move it back knowingly to include part of the history. An explicit warning is shown next to the field: any document validated on or after that date and never sent will be sent on the next job run.
 
== When a document cannot be processed ==
 
When a document cannot be processed (no valid recipient, PDF not found, email template not found, send failure), the module records an event in the document agenda with the reason in plain words, once per document and per reason. Looking at the invoice or proposal, you immediately see why nothing was sent.
 
== Multi-company (Multicompany) ==
 
The module works with the Multicompany module. Each entity sends and reminds '''its own documents only''', with its own settings, its own reminder levels and its own email templates. Sharing in Multicompany grants read visibility on the documents of another entity, it does not change their owner: a shared invoice is still reminded by the entity it belongs to. Nothing to configure. Before 1.3.3, an entity picked up the invoices and proposals of the entities it was allowed to see and processed them with its own settings.


==Miscellaneous==
== Triggers for developers (since 1.3.5) ==
* The module interface is translated into English, French, Spanish, German and Italian.
* Both automations are carried by a single daily scheduled job, created when the module is enabled.


=Prerequisites=
After each successful email, the module fires a trigger on the invoice or proposal, so that another module can react to it: <code>AUTOREMINDER_SEND</code> after the automatic sending of a validated document, <code>AUTOREMINDER_REMIND</code> after a reminder. The listener receives the document as <code>$object</code> and the details in <code>$object->context['autoreminder']</code>: <code>doctype</code>, <code>actioncomm_id</code> (the agenda event of this email), <code>level_id</code> and <code>level_days</code> (the reminder level, 0 and empty for the initial sending), <code>email_to</code>, <code>email_from</code>, <code>email_subject</code>. The module does not fire the core <code>BILL_SENTBYMAIL</code> and <code>PROPAL_SENTBYMAIL</code> triggers, which mean that a user sent the document from its card.
* Dolibarr 19 or above.
* PHP 7.1 or above.
* The Dolibarr '''Scheduled jobs''' module enabled, and a system cron calling Dolibarr (on most shared hosting, this task has to be created in the hosting control panel). Without it, no automatic sending happens.
* A working email setup in Dolibarr (Home - Setup - Emails).


=Installation=
= Installation =
{{InstallModuleEn}}


The zip is available for free on Dolistore: https://www.dolistore.com/product.php?id=2770&l=en
# Download the module zip file.
# Log in to Dolibarr as administrator, go to ''Home - Setup - Modules/Applications'', tab ''Deploy/install external app/module'', and upload the zip.
# Activate '''Auto Reminder''' in the ''Financial modules'' section.


The source code is public: https://framagit.org/Steph501/dolibarr-mod-autoreminder
The module creates its database table, its extrafields and a daily scheduled job automatically. When upgrading from a 1.x version, existing reminder levels are kept as invoice levels.


=Configuration=
After upgrading from 1.3.6 or an earlier version, disable then enable the module: the ticked "Exclude from automatic reminders" checkboxes become "None" in the "Reminders" field. Your settings and levels are kept.
{{ActivationModuleEn}}


Once the module is enabled, its setup page allows you to:
= Setup =
* enable the automatic sending of validated invoices, and choose the email template used;
* enable the reminders, and decide whether partially paid invoices are concerned;
* create the reminder levels: for each level, a delay in days and an email template.


With no level configured, no reminder is sent: the module says so on its setup page.
Before configuring the module, create your email templates in ''Home - Setup - Emails - Email templates'': type ''Send invoice'' for invoices, type ''Send commercial proposal'' for proposals. One template for the initial sending, one per reminder level.


=Usage=
Then open the module settings. At the top of the page, shared by both document types, the ''Default language of emails'' sets the language of the emails sent to third parties whose card has no language. Left empty, it is the language of your Dolibarr.


There is nothing to do on a daily basis: the scheduled job takes care of the sendings.
Then there is one tab per document type (Invoices, Proposals), each with:


To stop reminding a customer, open the third party card, edit it, and tick '''Exclude from automatic reminders'''. To skip one specific invoice, tick the same checkbox on that invoice card.
* the automatic sending switch and its email template. When enabled, today's date is stored: only documents validated from that date on will be sent. The date is editable (with a warning),
* the reminders switch, the ''Semi-automatic mode by default'' option (and, for invoices only, the partially paid option),
* the reminder levels table: delay in days + email template, unlimited number of levels.


=Upgrade=
The scheduled job ''AutoReminderJob'' runs once a day by default (see ''Home - Setup - Scheduled jobs'').


Upload the new zip over the previous one (Home - Setup - Modules - Deploy external module), then '''disable and enable the module again'''. This last step is required for the new fields to be created. Since version 1.1.0, your settings and your reminder levels are kept during this operation.
= Version history =


=Version history=
Full changelog, every version since the first one: [https://framagit.org/doli/modules/autoreminder/-/blob/main/ChangeLog.md ChangeLog.md]
* '''1.1.1''': module translated into Spanish, German and Italian.
* '''1.1.0''': exclusion of reminders per third party and per invoice. Fix: settings are no longer lost when the module is disabled.
* '''1.0.0''': initial release (automatic sending of validated invoices, reminders for unpaid invoices by levels).


=Support=
= Support =


By email: contact@stephane-mallet.fr
contact@stephane-mallet.fr


{{DEFAULTSORT:Auto Reminder}}
{{DEFAULTSORT:Auto Reminder}}

Latest revision as of 10:19, 27 October 2026

Information


Module name Auto Reminder
Editor / Editeur Stéphane Mallet Informatique - https://web-pilot.fr/offres/rsi
Download or buy page / Page achat ou téléchargement External module - https://www.dolistore.com/product.php?id=2770
Status / Statut / Estado Stable
Prerequisites / Prérequis Dolibarr 19 or higher

Dolibarr min version: See on Dolistore    Dolibarr max version: See on Dolistore

Last update date / Date mise à jour fiche / Fecha última actualización 2026-10-27
Note / Nota Tested on Dolibarr 24. Free module, GPLv3.

Auto Reminder automatically sends and follows up invoices and commercial proposals in Dolibarr. Everything is driven by a daily scheduled job.

Features

Invoices

  • Automatic sending of validated invoices by email, with the invoice PDF attached and a configurable email template.
  • Automatic reminders for unpaid invoices, based on configurable levels. Each level defines a delay in days relative to the due date (or the invoice date if no due date) and an email template. Negative delays are allowed (preventive reminder before the due date).
  • Option to include or exclude partially paid invoices.

Proposals (since 1.3.0)

  • Automatic sending of validated proposals by email, with the proposal PDF attached.
  • Automatic reminders for proposals still unanswered (not signed, not refused, not billed). Levels are counted from the end of validity date of the proposal (or its date if none).
  • Settings are fully separate from invoices: the module setup page has one tab for invoices and one tab for proposals, each with its own switches, email template and reminder levels.

Only the highest level reached is sent

For each document, only the highest reminder level reached is considered. Lower levels that were missed are never sent afterwards: a document already overdue when the module is enabled receives a single reminder, the one matching its actual delay, with the right template. Never a burst of reminders over several days.

Semi-automatic mode (since 1.3.7)

Instead of sending a reminder, the module can prepare it and let you send it yourself. Each reminder due becomes an alert:

  • a bell in the top bar shows how many invoices and proposals are to be reminded, and leads to them;
  • the invoice and proposal lists get a Reminder column and a To remind filter;
  • the card of the document shows the alert with a Remind button, which opens the native Dolibarr send form, prefilled with the template of the level in the language of the customer, and with the recipients of the module.

The alert closes when an email is sent from the card or scheduled with Doli Mail Later, when a higher level replaces it, or when you cancel it: only this level is then skipped. The mode is set per document type in the settings (Semi-automatic mode by default), and can be changed per third party and per document with the "Reminders" field.

Reminders per third party and per document (since 1.3.7)

The "Reminders" field is available on the third party card, the invoice card, the template invoice and the proposal card:

  • Automatic: the reminder goes out on its own;
  • Semi-automatic: the module prepares the reminder and flags it to you;
  • None: the reminder is neither sent nor prepared as an alert, and an alert already open disappears.

Left empty, the next level decides: the setting chosen on the invoice or the proposal takes precedence over that of the third party, which takes precedence over the module settings. Example: a third party in dispute is set to "None", one of its invoices to "Automatic": only that invoice is reminded. An invoice generated from a template invoice receives the setting of the template, which can then be changed on the invoice.

The initial sending of documents is not affected by this field. It replaces the "Exclude from automatic reminders" checkbox of previous versions (see Installation for the upgrade).

Recipient of the emails

The recipient is determined in this order, for sending and for reminders:

  1. The contact attached to the document (Contacts tab of the invoice or proposal), whatever its role. If several contacts are attached: billing then service then shipping for an invoice; follow-up then billing then shipping for a proposal.
  2. Otherwise the default contact of the third party for this document type (Contacts/Addresses tab of the third party).
  3. Otherwise the first active contact of the third party having an email.
  4. Otherwise the email address of the third party.

Since 1.3.1, every contact sharing the highest priority role is kept, not only the first one: two or three billing contacts attached to the same invoice all receive the email, in a single sending. The priority order is unchanged, so a billing contact still wins over a shipping one. Steps 1 and 2 above work this way; step 3 keeps a single recipient, since without a role nothing tells who handles the invoices.

Disabled contacts and contacts without email are never used. If no recipient is found, nothing is sent and an event is recorded in the document agenda.

Language of the emails (since 1.3.2)

An email goes out in the language of the third party, else in the default language of emails chosen in the module settings (since 1.3.7), else in the language of your Dolibarr. The module takes the first of these languages in which the email template exists, and sends the template of the settings as it is when none has it. The language fallback (es_MX to es_ES, then a template with no language) is the native Dolibarr one. Dates and amounts follow the language of the email sent. The attached PDF is not regenerated: it is the document as it stands.

Example: in a French Dolibarr with English as default language of emails, a third party without language receives English, a French third party French, and a German third party English when there is no German template.

Translating a template is done in Dolibarr itself, not in the module settings: create the template again with the SAME label, choose the language, then translate the subject and the content. Note that the language of third parties and templates only appears when the Dolibarr multi-language option is enabled.

Safety against mass sending

Only documents validated after the sending option was enabled are sent: enabling the module on an existing database never sends the historical documents. The reference date is stored when you enable the option, displayed in the settings, and editable: you can move it back knowingly to include part of the history. An explicit warning is shown next to the field: any document validated on or after that date and never sent will be sent on the next job run.

When a document cannot be processed

When a document cannot be processed (no valid recipient, PDF not found, email template not found, send failure), the module records an event in the document agenda with the reason in plain words, once per document and per reason. Looking at the invoice or proposal, you immediately see why nothing was sent.

Multi-company (Multicompany)

The module works with the Multicompany module. Each entity sends and reminds its own documents only, with its own settings, its own reminder levels and its own email templates. Sharing in Multicompany grants read visibility on the documents of another entity, it does not change their owner: a shared invoice is still reminded by the entity it belongs to. Nothing to configure. Before 1.3.3, an entity picked up the invoices and proposals of the entities it was allowed to see and processed them with its own settings.

Triggers for developers (since 1.3.5)

After each successful email, the module fires a trigger on the invoice or proposal, so that another module can react to it: AUTOREMINDER_SEND after the automatic sending of a validated document, AUTOREMINDER_REMIND after a reminder. The listener receives the document as $object and the details in $object->context['autoreminder']: doctype, actioncomm_id (the agenda event of this email), level_id and level_days (the reminder level, 0 and empty for the initial sending), email_to, email_from, email_subject. The module does not fire the core BILL_SENTBYMAIL and PROPAL_SENTBYMAIL triggers, which mean that a user sent the document from its card.

Installation

  1. Download the module zip file.
  2. Log in to Dolibarr as administrator, go to Home - Setup - Modules/Applications, tab Deploy/install external app/module, and upload the zip.
  3. Activate Auto Reminder in the Financial modules section.

The module creates its database table, its extrafields and a daily scheduled job automatically. When upgrading from a 1.x version, existing reminder levels are kept as invoice levels.

After upgrading from 1.3.6 or an earlier version, disable then enable the module: the ticked "Exclude from automatic reminders" checkboxes become "None" in the "Reminders" field. Your settings and levels are kept.

Setup

Before configuring the module, create your email templates in Home - Setup - Emails - Email templates: type Send invoice for invoices, type Send commercial proposal for proposals. One template for the initial sending, one per reminder level.

Then open the module settings. At the top of the page, shared by both document types, the Default language of emails sets the language of the emails sent to third parties whose card has no language. Left empty, it is the language of your Dolibarr.

Then there is one tab per document type (Invoices, Proposals), each with:

  • the automatic sending switch and its email template. When enabled, today's date is stored: only documents validated from that date on will be sent. The date is editable (with a warning),
  • the reminders switch, the Semi-automatic mode by default option (and, for invoices only, the partially paid option),
  • the reminder levels table: delay in days + email template, unlimited number of levels.

The scheduled job AutoReminderJob runs once a day by default (see Home - Setup - Scheduled jobs).

Version history

Full changelog, every version since the first one: ChangeLog.md

Support

contact@stephane-mallet.fr