No description
Find a file
2025-12-15 15:28:00 +01: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 Initial Bulk mailer 2023-07-25 22:59:59 +02:00
debian Fix: Clean composer.lock from /usr/lib/abraflexi-mailer in postrm 2025-10-25 13:18:21 +02: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 App Definition version added 2025-12-15 15:28:00 +01:00
src App Definition version added 2025-12-15 15:28:00 +01:00
templates Version 1.3.8 - reports update 2025-10-04 01:41:27 +02:00
tests Streamlines build process and updates PHP compatibility 2025-07-18 12:16:22 +02: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
bootstrap.sh Try to build in jenkins 2021-11-09 15:26:29 +01:00
composer.json Update dependencies and add CompanyLogo class 2025-07-18 12:42:17 +02:00
Dockerfile Initial commit 2021-01-03 08:14:07 +01:00
example.env Streamlines build process and updates PHP compatibility 2025-07-18 12:16:22 +02:00
LICENSE Initial commit 2020-12-19 13:34:37 +01:00
Makefile Streamlines build process and updates PHP compatibility 2025-07-18 12:16:22 +02: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 Unit Tests added 2022-11-26 21:14:32 +01:00
project-logo.svg SVG Icons fixed 2024-10-20 19:39:35 +02:00
README.cs.md Add exit code definitions to application schema 2025-11-20 23:05:04 +01:00
README.md Add exit code definitions to application schema 2025-11-20 23:05:04 +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
WARP.md Refines docs, adjusts settings, and removes outdated TODO 2025-11-08 18:53:11 +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.

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

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

Unsent mail reporter

Script which produces reports of unsent invoices in MultiFlexi-compliant format.

Since version 1.3.8, reports conform to the MultiFlexi report schema:

{
  "status": "warning",
  "timestamp": "2025-10-04T01:00:00+00:00",
  "message": "2 unsent invoices found affecting 1 companies",
  "artifacts": {
    "unsent_invoices": [
      {
        "id": 1131,
        "firma": {
          "value": "code:CUSTOMER",
          "target": "adresar",
          "ref": "/c/vitex_software/adresar/827.odeslat')",
          "showAs": "CUSTOMER: CUSTOMER l.t.d."
        },
        "kontaktEmail": "info@customer.com",
        "poznam": "",
        "kod": "VF1-0077/2024",
        "email": "info@customer.com",
        "recipients": "info@customer.com"
      }
    ]
  },
  "metrics": {
    "total_unsent": 2,
    "companies_affected": 1
  }
}

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

Exit Codes

This application uses the following exit codes:

  • 0: Success
  • 1: General error
  • 2: Misuse of shell command