Download the PHP package baraja-core/emailer without Composer

On this page you can find all versions of the php package baraja-core/emailer. 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 emailer

Emailer

Automation tool for e-mail distribution, queue management and advanced logging for Nette Framework with Doctrine ORM.

Main Principles

Architecture

Main Components

Component Description
Emailer Main service implementing Nette\Mail\Mailer interface. Handles sending e-mails directly or via queue.
Message Extended Nette\Mail\Message with support for priority, scheduled sending and localization.
QueueRunner Processes e-mail queue, handles retries and logs results.
EmailerDaemon Symfony Console command for running queue processor as daemon.
TemplateRenderer Renders e-mail templates using pluggable renderers (Latte, HTML, TXT).
EmailerLogger Persists logs to database with INFO/WARNING/ERROR levels.
GarbageCollector Cleans old logs and message bodies to keep database size manageable.
Fixer Interface for e-mail address correction (typo fixing).

Entity Structure

Entity Table Purpose
Email core__emailer_email Queue entry with status, attempts count, timing metrics
Log core__emailer_log Log entries linked to e-mails
Configuration - Runtime configuration (not persisted)

📦 Installation

It's best to use Composer for installation, and you can also find the package on Packagist and GitHub.

To install, simply use the command:

You can use the package manually by creating an instance of the internal classes, or register a DIC extension to link the services directly to the Nette Framework.

Requirements

Configuration

Register the extension in your config.neon:

Configuration Options

Option Type Default Description
useQueue bool true Enable queue mode (recommended for production)
defaultFrom string - Default sender address
adminEmails array [] Admin e-mails for system notifications
mail array - SMTP configuration (same as Nette mailer)

Basic Usage

Sending Simple E-mail

Sending Urgent E-mail (Bypasses Queue)

Using E-mail Service Classes

Create a reusable e-mail service by extending BaseEmail:

Then send it:

Scheduled Sending

Sending to Administrators

Running the Daemon

Set up a cron job to run the e-mail daemon:

The daemon will:

  1. Process queued e-mails for ~5 minutes (configurable timeout)
  2. Handle retries for failed e-mails
  3. Run garbage collection after processing

Queue Configuration

Adjust queue behavior via Configuration entity:

Setting Default Description
queueTimeout 295s How long daemon runs before exiting
queueEmailDelay 0.3s Delay between sending e-mails
queueCheckIterationDelay 2s Delay when queue is empty
maxAllowedAttempts 5 Max retry attempts before marking as failed

Template Rendering

Supported Formats

Format Extension Renderer
Latte .latte LatteRenderer
HTML .html HtmlRenderer
Plain Text .txt TextRenderer

Latte Template Example

Translation Support

Use {_} tags for translations:

Custom Renderers

Implement Renderer interface and tag it:

E-mail Statuses

Status Description
in-queue Waiting to be sent
not-ready-to-queue Scheduled for future
waiting-for-next-attempt Failed, will retry
sent Successfully delivered
preparing-error Template/build error
sending-error SMTP/delivery error

Custom Recipient Fixer

Implement Fixer interface to customize e-mail correction:

Register in DI container and it will be used automatically.

Logging

All e-mail operations are logged with three severity levels:

Logs are automatically cleaned up:

Author

Jan Barasek (https://baraja.cz)

📄 License

baraja-core/emailer is licensed under the MIT license. See the LICENSE file for more details.


All versions of emailer with dependencies

PHP Build Version
Package Version
Requires php Version ^8.0
nette/mail Version ^3.0
nette/utils Version ^3.0
latte/latte Version ^2.5
baraja-core/localization Version ^2.0
baraja-core/dynamic-configuration Version ^2.0
baraja-core/html-to-text Version ^2.0
baraja-core/doctrine-mail-message Version ^2.0
baraja-core/network Version ^1.0
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 baraja-core/emailer contains the following files

Loading the files please wait ...