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:
- "contactEmail" from the document
- company email
- primary contact email
- 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 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
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
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
This tool uses the following libraries for its functionality:
- EasePHP Framework - helper functions, e.g., logging
- AbraFlexi - communication with AbraFlexi
- AbraFlexi Bricks - classes for Customer, Reminder, and ReminderSender are used
This software would not have been created without the support of:
- Regular reports from AbraFlexi
- Reminder sender
- Client Zone for AbraFlexi
- Tools for testing and managing AbraFlexi
- Monitoring the functionality of the AbraFlexi server
- AbraFlexi server without graphical dependencies
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.
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