I would like to propose a small core feature for 25.0 and would value your opinion, and your support if you find it useful, before I open a pull request.
The need
When you send a proposal, order or invoice from its card, you can’t tell whether the customer opened it. Mass mailing records reads, but mail sent from the “Send email” form doesn’t. Modules that send mail on their own (webmail, CRM follow-ups, ticketing add-ons…) each have to build their own tracking, with their own public page, tables and events.
The __CHECK_READ__ substitution looks as if it does this in the send form, but outside mass mailing it never records anything.
The idea: one open tracker in core, used by the send form and available to modules
-
Off by default. A setting in Setup > Emails turns it on, with a note about consent and disclosure rules
(GDPR/ePrivacy and similar). -
Opt-in per message. A “Track opening” checkbox in the send form, next to the delivery receipt, unticked by
default. -
Recorded on the agenda. The open is stored on the event of the sent email: open count, first and last
open. The first open adds an “Email opened” event linked to the same document, third party, contacts and
project, so it shows on the document’s timeline. That event is a normal automatic event, switchable in Agenda
setup. -
Privacy-minded. Only counters and dates. No IP address or user agent is stored. The image goes into the
delivered message only, never into the event note, so the sender viewing their own event isn’t counted. -
A tool for modules. Any module that sends mail and logs it as an agenda event can use the same mechanism instead of building its own:
require_once DOL_DOCUMENT_ROOT.'/comm/action/class/actioncomm.class.php'; $key = ActionComm::newEmailTrackKey(); $html .= ActionComm::getEmailTrackImage($key); // add to the HTML body you send // then, on the event you create for this email: $actioncomm->email_track_key = $key; // or, when sending through an object's *_SENTBYMAIL trigger: $object->context['email_track_key'] = $key;Core’s public page (
public/agenda/emailopen.php) then records the opens, and the “Email opened” event comes through the usualACTION_CREATEtrigger, with codeAC_EMAIL_OPENED. Notifications, webhooks or your own module can react to it.Honest limits
Opens are approximate. Mail apps that block images miss them, and Apple Mail Privacy Protection or security scanners load images without anyone reading. Plain-text emails can’t be tracked. Some spam filters look at tracking images, which is one more reason it’s off by default.
Where it stands
We have a working prototype on a branch of
develop: the setting, the checkbox, the open counters on the event card, the “Email opened” event, and an upgrade script. Mass actions (one email covering several documents) would come in a second, smaller step.What I want to hear from you
- Would you use this, or do you rule out open tracking for privacy reasons? Both answers help.
- If you write modules: is the API above enough? Would you prefer a dedicated
EMAIL_OPENEDtrigger in addition toACTION_CREATE? - Should the “Email opened” event be created on the first open only (our proposal), or should every open be listed? (I’m logging each open).
- Are there jurisdictions or sectors where you’d need it disabled for all users, or limited to some?
If you support the idea, a reply here helps us show the maintainers that there is interest. Testers are also welcome once the pull request is open.
If you’re wanting to use the email module I’ve got with a working version of this, DM me.




