Module PostmarkApp

Revision as of 13:22, 6 January 2026 by AlexBordaraud (talk | contribs) (Création du module PostmarkApp)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

POSTMARKAPP

subtitle: POSTMARKAPP DOCUMENTATION
source-highlighter: rouge
companyname: Lysis
corpname: Lysis
orgname: Lysis
author: Alex BORDARAUD
email: alex@lysis.net
creator: Alex BORDARAUD
title: Documentation of module PostmarkApp
subject: This document is the documentation of module PostmarkApp.
keywords: PostmarkApp, Postmark, Email, Dolibarr, Webhook
docdate: 2026-01-06
toc: manual
toc-placement: preamble


== TOPIC OF DOCUMENT

This is the documentation of module PostmarkApp - Postmark email integration for Dolibarr.


  • Log of versions of document*

[options="header",format="csv"] |=== Author, Date, Version Alex BORDARAUD <alex@lysis.net>, 2026-01-06, Version 1.5.2 |===


[NOTE]

==

This document was generated using Dolibarr ERP CRM process

==
toc: manual
toc-placement: preamble


== INTRODUCTION

=== English

PostmarkApp is a Dolibarr module that replaces the native email sending system with Postmark's transactional email service. It provides advanced email tracking capabilities including delivery confirmation, open tracking, click tracking, and bounce handling.

=== Français

PostmarkApp est un module Dolibarr qui remplace le système natif d'envoi d'emails par le service de messagerie transactionnelle Postmark. Il offre des fonctionnalités avancées de suivi des emails incluant la confirmation de livraison, le suivi d'ouverture, le suivi des clics et la gestion des rebonds.


== FEATURES / FONCTIONNALITÉS

=== English

  • *Email Sending via Postmark API*: All emails sent from Dolibarr are routed through Postmark
  • *Delivery Tracking*: Know when your emails are delivered
  • *Open Tracking*: Track when recipients open your emails (first open only)
  • *Click Tracking*: Monitor which links are clicked in your emails
  • *Bounce Handling*: Automatically handle bounced emails
  • *Spam Complaint Tracking*: Be notified of spam complaints
  • *Dolibarr Events Integration*: All email events are logged in Dolibarr's agenda
  • *Object Linking*: Events are linked to related Dolibarr objects (third parties, contacts, proposals, invoices, etc.)

=== Français

  • *Envoi d'emails via l'API Postmark* : Tous les emails envoyés depuis Dolibarr passent par Postmark
  • *Suivi de livraison* : Savoir quand vos emails sont livrés
  • *Suivi d'ouverture* : Suivre quand les destinataires ouvrent vos emails (première ouverture uniquement)
  • *Suivi des clics* : Surveiller les liens cliqués dans vos emails
  • *Gestion des rebonds* : Gérer automatiquement les emails rebondis
  • *Suivi des plaintes spam* : Être notifié des plaintes spam
  • *Intégration événements Dolibarr* : Tous les événements email sont enregistrés dans l'agenda Dolibarr
  • *Liaison aux objets* : Les événements sont liés aux objets Dolibarr concernés


== REQUIREMENTS / PRÉREQUIS

  • Dolibarr 16.0+
  • PHP 7.4+ with cURL extension
  • Postmark account with Server API Token
  • Agenda module enabled in Dolibarr


== INSTALLATION

=== English

1. Download the module package `module_postmarkapp-x.y.z.zip` 2. Extract to `htdocs/custom/postmarkapp/` or use Dolibarr's module deployment feature 3. Go to *Home > Setup > Modules/Applications* 4. Search for "PostmarkApp" and enable the module 5. Configure the module in *Setup > Modules > PostmarkApp Setup*

=== Français

1. Téléchargez le package `module_postmarkapp-x.y.z.zip` 2. Extrayez dans `htdocs/custom/postmarkapp/` ou utilisez le déploiement de modules Dolibarr 3. Allez dans *Accueil > Configuration > Modules/Applications* 4. Recherchez "PostmarkApp" et activez le module 5. Configurez dans *Configuration > Modules > Configuration PostmarkApp*


== CONFIGURATION

=== Step 1: Server API Token / Étape 1 : Server API Token

1. Log in to your Postmark account at https://postmarkapp.com 2. Select your server / Sélectionnez votre serveur 3. Go to *API Tokens* tab / Allez dans l'onglet *API Tokens* 4. Copy the *Server API Token* / Copiez le *Server API Token* 5. Paste it in the PostmarkApp configuration page / Collez-le dans la page de configuration 6. Click *Validate* to test the connection / Cliquez sur *Valider* pour tester

=== Step 2: Options / Étape 2 : Options

  • *Message Stream*: Select the message stream (default: "outbound") / Sélectionnez le flux de messages
  • *Track Opens*: Enable/disable open tracking / Activer/désactiver le suivi d'ouverture
  • *Track Clicks*: Enable/disable click tracking (requires HTML emails) / Activer/désactiver le suivi des clics
  • *Replace Dolibarr Mailer*: Enable to route all emails through Postmark / Activer pour router tous les emails via Postmark

=== Step 3: Webhook (Optional) / Étape 3 : Webhook (Optionnel)

Webhooks allow Postmark to notify Dolibarr of email events in real-time. Les webhooks permettent à Postmark de notifier Dolibarr des événements email en temps réel.

  • Automatic Setup / Configuration automatique:*

Click *Create Webhook Automatically* / Cliquez sur *Créer le webhook automatiquement*

  • Manual Setup / Configuration manuelle:*

1. Copy the webhook URL displayed in the configuration / Copiez l'URL du webhook affichée 2. Go to Postmark > Servers > Your Server > Webhooks / Allez dans Postmark > Servers > Votre serveur > Webhooks 3. Add a new webhook with the copied URL / Ajoutez un nouveau webhook avec l'URL copiée 4. Enable: Delivery, Open (First Open Only), Click, Bounce, Spam Complaint / Activez ces événements


== DATA SPECIFICATIONS

=== Database Table: llx_postmarkapp_events

.Database columns [cols="20,20,60",frame="topbot"] |==== |Column |Type |Description

|rowid |INTEGER |Primary key / Clé primaire |email_id |VARCHAR(255) |Postmark MessageID |event_type |VARCHAR(50) |Event type (Sent, Delivery, Open, Click, Bounce, SpamComplaint) |recipient |VARCHAR(255) |Email recipient / Destinataire |subject |VARCHAR(255) |Email subject / Sujet |fk_soc |INTEGER |Linked third party ID / ID tiers lié |fk_contact |INTEGER |Linked contact ID / ID contact lié |fk_element |INTEGER |Linked element ID / ID élément lié |element_type |VARCHAR(50) |Element type (propal, facture, commande, etc.) |fk_actioncomm |INTEGER |Linked ActionComm ID / ID événement lié |event_data |TEXT |JSON data from webhook / Données JSON du webhook |date_creation |DATETIME |Event timestamp / Horodatage |====


== EVENT TYPES / TYPES D'ÉVÉNEMENTS

.Event types [cols="15,25,25,35",frame="topbot"] |==== |Event |Description EN |Description FR |Code

|Sent |Email sent via Postmark |Email envoyé via Postmark |POSTMARK_SENT |Delivered |Email delivered |Email délivré |POSTMARK_DELIVERY |Opened |Email opened |Email lu |POSTMARK_OPEN |Clicked |Link clicked |Lien cliqué |POSTMARK_CLICK |Bounced |Email bounced |Email rebondi |POSTMARK_BOUNCE |Spam |Spam complaint |Plainte spam |POSTMARK_SPAM_COMPLAINT |====


== MATRIX OF PERMISSIONS / MATRICE DES PERMISSIONS

.Permissions [cols="20,40,40",frame="topbot"] |==== |Permission |Description |PHP Check

|Read |Read PostmarkApp configuration |$user->hasRight('postmarkapp', 'read') |Write |Modify PostmarkApp configuration |$user->hasRight('postmarkapp', 'write') |====


== TROUBLESHOOTING / DÉPANNAGE

=== Emails not sending / Emails non envoyés

1. Check that `POSTMARKAPP_REPLACE_MAILER` is enabled / Vérifiez que `POSTMARKAPP_REPLACE_MAILER` est activé 2. Verify the Server API Token is valid / Vérifiez que le Server API Token est valide 3. Check Dolibarr logs for error messages / Consultez les logs Dolibarr 4. Ensure the "From" address is a verified Sender Signature in Postmark / Vérifiez que l'adresse "From" est vérifiée dans Postmark

=== Webhooks not received / Webhooks non reçus

1. Verify the webhook URL is accessible from the internet / Vérifiez que l'URL est accessible depuis Internet 2. Check that webhooks are created in Postmark dashboard / Vérifiez les webhooks dans Postmark 3. Test webhooks using the built-in test buttons / Testez avec les boutons intégrés

=== Click tracking not working / Suivi des clics non fonctionnel

Click tracking requires emails to be sent in HTML format. Plain text emails cannot track clicks. Le suivi des clics nécessite des emails au format HTML. Les emails texte brut ne peuvent pas suivre les clics.


== API DOCUMENTATION

=== Postmark API Endpoints Used

  • `POST /email` - Send email
  • `GET /server` - Test connection
  • `GET /message-streams` - List message streams
  • `GET /senders` - List sender signatures
  • `GET /webhooks` - List webhooks
  • `POST /webhooks` - Create webhook

=== Webhook Endpoint

`POST /custom/postmarkapp/webhook.php`

Receives webhook notifications from Postmark for the following events: - Delivery - Open (First Open Only) - Click - Bounce - SpamComplaint


== CHANGELOG

See link:../CHANGELOG.md[CHANGELOG.md] for full version history.

=== Version 1.5.2 (2026-01-06)

  • Simplified event notes and labels
  • Removed duplicate "Sent" event (uses Dolibarr native system)
  • Added bilingual documentation
  • Added multi-language support (FR, EN, DE, ES, IT, PT, NL)
  • Added Agenda module dependency
  • Added automatic triggers for Postmark events

=== Version 1.0 (2026-01-06)

  • Initial release
  • Postmark API integration
  • Webhook handling
  • Event tracking


== LICENSE

This module is distributed under the GNU General Public License v3 (GPLv3).

Copyright (C) 2026 Lysis - Alex BORDARAUD

== SUPPORT

For support, please contact: alex@lysis.net Website: https://lysis.net