Download the PHP package horstoeko/zugferdmail without Composer

On this page you can find all versions of the php package horstoeko/zugferdmail. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package zugferdmail

IMAP/POP3-Watcher for E-Documents

Latest Stable Version PHP version License

Build Status Release Status

Table of Contents

Note

[!CAUTION] This library is currently still considered experimental and should therefore be used with caution. I would be happy for an issue to be posted if bugs are found.

License

The code in this project is provided under the MIT license.

Overview

With this library it is possible to monitor mail accounts (IMAP and POP3) and to check and process incoming electronic invoice documents (ZUGFeRD PDF and XML).

Dependencies

This package makes use of

Installation

There is one recommended way to install horstoeko/zugferdmail via Composer:

Usage

For detailed eplanation you may have a look in the examples of this package and the documentation attached to every release.

First, it is necessary to configure the library so that it is aware of the mail accounts to be checked. For IMAP accounts, the folders to be monitored must also be defined. In addition, any actions (handlers) can be defined for each mail account.

Configuration

First you need to create a configuration instance:

The mail accounts to be monitored must then be defined. You can also specify the folders and mimetypes to be checked:

Last but not least, the actions (handlers) to be performed are specified for each mail account, which are executed when a ZUGFeRD or XML document is found. Some of these handlers are already available, but you can also define your own actions:

You can also define callbacks to call when a document was found. If such a callback function returns the value false, then all remaining callback functions are not called:

Please note that the callbacks are neither loaded from a configuration file nor saved in one.

Check mail accounts for matching mails:

To perform the actual handling of all mail accounts, instantiate the class , to which the configuration is passed. The monitoring is started by calling the method

Predefined handlers

Class Description
ZugferdMailHandlerNull Does not perform any operations
ZugferdMailHandlerCli Displays brief information about the e-invoice document found on the console
ZugferdMailHandlerCopyMessage Copies the message to another (different) directory
ZugferdMailHandlerMoveMessage Moves the message to another (different) directory
ZugferdMailHandlerDeleteMessage Deletes the message
ZugferdMailHandlerMarkSeenMessage Marks the message as seen
ZugferdMailHandlerMarkUnseenMessage Marks the message as unseen
ZugferdMailHandlerSaveToFile Saves the E-Document to a specified directory, optionally with a different filename

Implement your own handler

It is quite easy to implement your own action (handler). To do this, define your own class which extends a class from . This abstract class defines a single method , which is passed information about the folder, message, attachment and the e-invoice document:

An example:

The parameter $recognitionType is one of the constants from

Name Vakue Description
ZFMAIL_RECOGNITION_TYPE_PDF_CII 0 The document was recognized from a ZUGFeRD/Factur-X PDF attachment
ZFMAIL_RECOGNITION_TYPE_XML_CII 1 The document was recognized from a ZUGFeRD/Factur-X XML attachment
ZFMAIL_RECOGNITION_TYPE_XML_UBL 2 The document was recognized from a ZUGFeRD/Factur-X XML attachment (in UBL-Syntax)

A small example

A possible implementation could look like this, for example:

Console

This library also includes a console application with which it is possible to carry out corresponding operations via shell. To get an overview of the existing commands from the “zfmail” namespace, use:

Start monitoring a mailbox

The command zfmail:processmailboxfolders is available for monitoring a mailbox via shell:

This has the following parameters:

Parameter Description Default Multiple
host The IP or hostname :x:
port The port on the host 993 :x:
protocol The protocol to use imap :x:
encryption The encryption method to use ssl :x:
validateCert If given the SSL certificates will be validated false :x:
username The username to use for login :x:
password The password to use for login :x:
authentication The authentication method to use :x:
timeout The connection timeout 30 :x:
folder A folder to look into :heavy_check_mark:
mimetype An attachment mimetype to check :heavy_check_mark:
handler A handler to use :heavy_check_mark:
enableublsupport If given the application will check for UBL syntax too false :x:
enablesymfonyvalidation If given the application will validate the XML using symfony validator against the yaml definitions false :x:
enablexsdvalidation If given the application will validate the XML against the XSD definitions false :x:
enablekositvalidation If given the application will validate the XML using the KosIT validator (JAVA required) false :x:
enableunseenonly If given only unseen message are processed false :x:

Example usage


All versions of zugferdmail with dependencies

PHP Build Version
Package Version
Requires php Version >=7.3
horstoeko/mimedb Version ^1
horstoeko/stringmanagement Version ^1.0
horstoeko/zugferd Version ^1
horstoeko/zugferdublbridge Version ^1
swaggest/json-schema Version ^0.12.42
symfony/console Version ^5|^6|^7
symfony/mime Version ^5|^6|^7
vlucas/phpdotenv Version ^5
webklex/php-imap Version ^4|^5
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package horstoeko/zugferdmail contains the following files

Loading the files please wait ....