Document Sender for AbraFlexi https://multiflexi.eu/
Find a file
2026-03-30 12:16:04 +02:00
.github Add exit code definitions to application schema 2025-11-20 23:05:04 +01:00
.vscode Refines docs, adjusts settings, and removes outdated TODO 2025-11-08 18:53:11 +01:00
bin feat: Add confirmation mailers (Potvrzeni) with CLI commands 2026-02-27 20:12:44 +01:00
debian debian autoloader update 2026-03-23 02:13:32 +01:00
doc Initial commit 2021-01-03 08:14:07 +01:00
i18n Streamlines build process and updates PHP compatibility 2025-07-18 12:16:22 +02:00
multiflexi refactor: update dependencies and requirements in multiflexi app configurations 2026-03-15 10:44:07 +01:00
src fix: Remove 'MAIL_FROM' from initialization parameters in SendUnsent.php 2026-03-30 12:16:04 +02:00
templates Version 1.3.8 - reports update 2025-10-04 01:41:27 +02:00
tests refactor: Migrate mailer classes to a new Symfony Mailer-based HtmlMailer and adjust type casting. 2026-03-14 22:11:04 +01:00
.gitignore Update Debian packaging and improve warning message clarity 2025-08-18 17:57:07 +02:00
.php-cs-fixer.dist.php Update schemas and allow unsupported PHP versions in config 2025-09-11 17:23:48 +02:00
abraflexi-bulkmail.svg SVG Icons fixed 2024-10-20 19:39:35 +02:00
abraflexi-mailer_1.3.8_all.deb Version 1.3.8 - reports update 2025-10-04 01:41:27 +02:00
abraflexi-send-unsent-with-attachments.svg SVG Icons fixed 2024-10-20 19:39:35 +02:00
abraflexi-show-unsent.svg SVG Icons fixed 2024-10-20 19:39:35 +02:00
AGENTS.md Modernize Debian packaging 2026-03-02 18:47:01 +01:00
bootstrap.sh Try to build in jenkins 2021-11-09 15:26:29 +01:00
composer.json feat: update mailer to use Symfony Mailer, add MAIL_DSN configuration, and clean up code 2026-03-15 00:09:00 +01:00
Dockerfile Initial commit 2021-01-03 08:14:07 +01:00
example.env feat: update mailer to use Symfony Mailer, add MAIL_DSN configuration, and clean up code 2026-03-15 00:09:00 +01:00
LICENSE Initial commit 2020-12-19 13:34:37 +01:00
Makefile Adds multiflexi app JSON validation and cleans backups 2026-01-05 00:11:28 +01:00
matcher.json Initial commit 2021-01-03 08:14:07 +01:00
multiflexi-abraflexi-mailer_1.3.8_all.deb Version 1.3.8 - reports update 2025-10-04 01:41:27 +02:00
phpstan-default-baseline.neon Strict Types used 2024-09-09 12:33:43 +02:00
phpstan-default.neon.dist Strict Types used 2024-09-09 12:33:43 +02:00
phpunit.xml refactor: Migrate mailer classes to a new Symfony Mailer-based HtmlMailer and adjust type casting. 2026-03-14 22:11:04 +01:00
project-logo.svg SVG Icons fixed 2024-10-20 19:39:35 +02:00
README.cs.md feat: Add confirmation mailers (Potvrzeni) with CLI commands 2026-02-27 20:12:44 +01:00
README.md fix: clean up README formatting and improve link presentation 2026-03-15 00:09:42 +01:00
social-preview.png Version 1.3.8 - reports update 2025-10-04 01:41:27 +02:00
social-preview.svg SVG Icons fixed 2024-10-20 19:39:35 +02:00
Vagrantfile MultiFlexi definition update 2023-11-15 11:50:32 +01:00

Document Sender for AbraFlexi

Package Logo

Scripts for sending documents are available:

SendUnsent.php - sends unsent documents in bulk directly from AbraFlexi in the standard way

SendUnsentAttachments.php - finds unsent documents, attaches attachments to them, and sends them via the default PHP mailer or SMTP

Documents are sent to addresses according to the following key:

  1. "contactEmail" from the document
  2. company email
  3. primary contact email
  4. contact email

If an address with the prefix cc is found in the document note, e.g., "cc:email@example.com, cc:copy@example.com", a copy will also be sent to these emails.

Configuration

Configuration is done by entering directives into the .env file, defining them as constants, or setting environment variables. The Debian package expects the configuration file in the /etc/abraflexi-mailer folder, where a sample file .env.template is available.

Mail Transport (MAIL_DSN)

The mailer now uses the MAIL_DSN variable, following the Symfony mailer DSN format. The previously used EASE_SMTP is deprecated.

Example for SMTP:

MAIL_DSN="smtp://username:password@mail.example.com:587?encryption=tls&auth_mode=plain"

Replace username, password, and mail.example.com with your actual SMTP credentials and server.

APP_NAME=AbraFlexiMailer                        - application name in syslog
APP_DEBUG=true                                  - enable debug mode
MUTE=true                                       - do not send messages to recipients but to

MAIL_DSN="smtp://username:password@mail.example.com:587?encryption=tls&auth_mode=plain"  - mail transport DSN (Symfony format)
EASE_MAILTO=info@vitexsoftware.cz               - messages are sent here if mute is active

ABRAFLEXI_URL="https://demo.abraflexi.eu:5434"
ABRAFLEXI_LOGIN="winstrom"
ABRAFLEXI_PASSWORD="winstrom"
ABRAFLEXI_COMPANY="demo"
ABRAFLEXI_CUSTOMER="demo"

ADD_LOGO=true                                   - include company logo in the email
ADD_QRCODE=true                                 - include QR payment image in the email
MAIL_CC=info@vitexsoftware.cz                   - send all emails also in copy to this address
MAIL_FROM=office@vitexsoftware.cz               - sender address

EASE_LOGGER="console|syslog"                    - logging method
SEND_LOCKED=False                               - try to temporarily unlock a locked document
DRY_RUN=False                                   - if enabled, does not write the date and sending status to documents

Templates

It is assumed that the template is named according to the record type, e.g., invoice-issued.ftl and is stored in the "templates" folder ( /usr/share/abraflexi-mailer/templates in Debian )

The following variables can be used in the templates:

  • ${application} Application name, i.e., "AbraFlexi BulkMail"
  • ${user} User object, which can be further worked with
  • ${company} Company settings
  • ${uzivatelJmeno} Your first name
  • ${uzivatelPrijmeni} Your last name
  • ${titulJmenoPrijmeni} Your full name, including achieved titles
  • ${nazevFirmy} Company name
  • ${doklad} Document to be sent

Bulk Mailer

If we want to send emails to all clients from Nerudova Street in Prague:

abraflexi-bulkmail templates/template.ftl "(city='Prague' AND street='Nerudova')"

When used in a template, the variables for each sent message are filled from https://demo.flexibee.eu/c/demo_de/addressbook/properties

Dependencies

This tool uses the following libraries for its functionality:

Acknowledgements

This software would not have been created without the support of:

Spoje.Net

Other software for AbraFlexi

MultiFlexi

AbraFlexi Mailer is ready to run as a MultiFlexi application. See the full list of ready-to-run applications within the MultiFlexi platform on the application list page.

Since version 1.3.8, all produced reports conform to the MultiFlexi report schema, ensuring proper integration and monitoring capabilities within the MultiFlexi ecosystem.

MultiFlexi App

Debian/Ubuntu

For Linux, .deb packages are available. Please use the repo:

    echo "deb http://repo.vitexsoftware.com $(lsb_release -sc) main" | sudo tee /etc/apt/sources.list.d/vitexsoftware.list
    sudo wget -O /etc/apt/trusted.gpg.d/vitexsoftware.gpg http://repo.vitexsoftware.cz/keyring.gpg
    sudo apt update
    sudo apt install abraflexi-mailer

After installing the package, the following new commands are available in the system:

  • abraflexi-send - sends a document
  • abraflexi-send-unsent - sends unsent documents
  • abraflexi-send-attachments - sends a document with attachments (TODO)
  • abraflexi-send-unsent-attachments - sends unsent documents with attachments
  • abraflexi-show-unsent - lists unsent documents
  • abraflexi-bulkmail - sends emails to contacts from the address book in bulk
  • abraflexi-potvrzeni-prijeti-uhrady - sends payment receipt confirmation to the customer
  • abraflexi-potvrzeni-prijeti-faktury - sends invoice receipt confirmation to the supplier
  • abraflexi-potvrzeni-odeslani-uhrady - sends payment sent (bank order) confirmation to the supplier

Confirmation Commands

The confirmation commands accept a document identifier via --docid parameter or DOCID environment variable. Based on the document ID, the recipient is determined from the address book and a confirmation email is sent.

abraflexi-potvrzeni-prijeti-uhrady --docid=VF1-0001/2026
DOCID=123 abraflexi-potvrzeni-prijeti-faktury

Additional environment variables for confirmations:

  • MAIL_SIGNATURE - email signature text appended to the message
  • SEND_INFO_TO - Cc address for confirmation copies

Exit Codes

This application uses the following exit codes:

  • 0: Success
  • 1: General error / Missing document ID
  • 2: Failed to send email
  • 3: Cannot read document from AbraFlexi