Skip to content

VitexSoftware/abraflexi-mailer

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Package Logo

Document Sender for AbraFlexi

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 protected], cc:[email protected]", 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=[email protected]               - 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=[email protected]                   - send all emails also in copy to this address
MAIL_FROM=[email protected]               - 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.

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