Module PostmarkApp

From Dolibarr ERP CRM Wiki
Revision as of 13:29, 6 January 2026 by AlexBordaraud (talk | contribs)
Jump to navigation Jump to search

Template:Dolibarr module

PostmarkApp is a Dolibarr module that replaces the native email sending system with Postmark, a professional transactional email service.

Why use PostmarkApp?

English

Legal proof and dispute resolution: Having precise tracking of email delivery, opening, and link clicks provides valuable evidence in case of disputes. You can prove that:

  • An invoice or quote was successfully delivered to your client
  • The recipient opened the email and read it
  • They clicked on links (payment, validation, etc.)

This traceability is essential for businesses that need to demonstrate that important information was transmitted and received.

Français

Preuve, traçabilité et résolution de litiges : Disposer d'un suivi précis de la livraison, de l'ouverture et des clics sur les liens de vos emails constitue une preuve précieuse en cas de litige. Vous pouvez prouver que :

  • Une facture ou un devis a bien été délivré à votre client
  • Le destinataire a ouvert l'email et l'a lu
  • Il a cliqué sur les liens (paiement, validation, etc.)

Cette traçabilité est essentielle pour les entreprises qui doivent démontrer que des informations importantes ont été transmises et reçues.

Features

  • Email Sending via Postmark API - All Dolibarr emails are sent 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 module
  • Object Linking - Events are linked to related Dolibarr objects (invoices, proposals, orders, etc.)
  • Multi-language - Available in 7 languages (FR, EN, DE, ES, IT, PT, NL)

Requirements

  • Dolibarr 19.0 or higher
  • PHP 7.1 or higher with cURL extension
  • Postmark account with Server API Token
  • Agenda module must be enabled

Installation

  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 > Settings

Configuration

Step 1: Server API Token

  1. Log in to your Postmark account at https://postmarkapp.com
  2. Select your server
  3. Go to API Tokens tab
  4. Copy the Server API Token
  5. Paste it in the PostmarkApp configuration page
  6. Click Validate to test the connection

Step 2: Options

  • Message Stream: Select the message stream to use (default: "outbound")
  • Track Opens: Enable/disable open tracking
  • Track Clicks: Enable/disable click tracking (requires HTML emails)
  • Replace Dolibarr Mailer: Enable to route all emails through Postmark

Step 3: Webhook

Webhooks allow Postmark to notify Dolibarr of email events in real-time.

Automatic Setup:

  • Click Create Webhook Automatically
  • The webhook URL will be registered with Postmark

Manual Setup:

  1. Copy the webhook URL displayed in the configuration
  2. Go to Postmark > Servers > Your Server > Webhooks
  3. Add a new webhook with the copied URL
  4. Enable: Delivery, Open (First Open Only), Click, Bounce, Spam Complaint

How it works

Once enabled, all emails sent from Dolibarr will be routed through Postmark. The module intercepts the native email sending and replaces it with Postmark's API.

When a webhook is configured, Postmark will notify your Dolibarr installation of email events:

Event Description Dolibarr Code
Sent Email sent via Postmark POSTMARK_SENT
Delivered Email delivered to recipient's server POSTMARK_DELIVERY
Opened Recipient opened the email POSTMARK_OPEN
Clicked Recipient clicked a link POSTMARK_CLICK
Bounced Email could not be delivered POSTMARK_BOUNCE
Spam Recipient marked as spam POSTMARK_SPAM_COMPLAINT

Each event creates an entry in Dolibarr's Agenda, linked to the original object.

Database

The module creates one custom table:

Column Type Description
rowid INTEGER Primary key
email_id VARCHAR(255) Postmark MessageID
event_type VARCHAR(50) Event type
recipient VARCHAR(255) Email recipient
subject VARCHAR(255) Email subject
fk_soc INTEGER Linked third party ID
fk_contact INTEGER Linked contact ID
fk_element INTEGER Linked element ID
element_type VARCHAR(50) Element type (propal, facture, etc.)
fk_actioncomm INTEGER Linked ActionComm ID
event_data TEXT JSON data from webhook
date_creation DATETIME Event timestamp

Troubleshooting

Emails not sending

  1. Check that POSTMARKAPP_REPLACE_MAILER is enabled
  2. Verify the Server API Token is valid
  3. Check Dolibarr logs for error messages
  4. Ensure the "From" address is a verified Sender Signature in Postmark

Webhooks not received

  1. Verify the webhook URL is accessible from the internet
  2. Check that webhooks are created in Postmark dashboard
  3. Test webhooks using the built-in test buttons
  4. Check server logs for incoming requests

Click tracking not working

Click tracking requires emails to be sent in HTML format. Plain text emails cannot track clicks.

Screenshots

Changelog

Version 1.5.2 (2026-01-06)

  • Simplified event notes and labels
  • Removed duplicate "Sent" event
  • Added bilingual documentation
  • Added multi-language support

Links

License

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

Professional Services / Services professionnels

English

Need help with setup? We can assist you with:

  • Installation and configuration of the PostmarkApp module
  • Postmark account setup and sender signature verification
  • Webhook configuration and testing
  • Integration with your existing Dolibarr workflows
  • Training for your team

Contact us for a personalized quote.

Français

Besoin d'aide pour le paramétrage ? Nous pouvons vous accompagner pour :

  • L'installation et la configuration du module PostmarkApp
  • La création de votre compte Postmark et la vérification des signatures d'expéditeur
  • La configuration et les tests des webhooks
  • L'intégration avec vos processus Dolibarr existants
  • La formation de vos équipes

Contactez-nous pour un devis personnalisé.

Author

Alex BORDARAUD
Website: https://lysis.net