Skip to content
Addon for catch mails in Nette to filesystem and showing it in debug bar.
PHP HTML
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
src/FileMailer
LICENSE
README.md
composer.json

README.md

FileMailer

E-mails catching addon for Nette Framework. Emails are stored into files and shown in Tracy bar.

!WARNING! - After setting up this addon, all e-mails are not sent, but ONLY stored on filesystem and shown in Tracy bar.

Demo

Killer features

  • Simple instalation
  • Extensive configuration options
  • Full access to headers
  • Plain text and HTML output
  • Possibility to download the attachments
  • Parser caching

Installation

Add package to your project by the Composer:

composer require rm/filemailer

or download addon manually from GitHub and unpack it in place indexed by RobotLoader.

Configuration

The addon consists of two parts. The first one is the FileMailer which replaces the IMailer service and stores e-mails to filesystem. The second one is the MailPanel which is the Tracy bar panel and shows e-mails stored by FileMailer.

Default options are used in following examples.

Setup by extension

Register new compiler extension in config.neon and optionally configure:

extensions:
	mailer: RM\MailPanel\DI\MailPanelExtension

mailer:
	newMessageTime: '-2 seconds'    # how long consider email as new
	show: [subject, from, to]       # which headers show in overview
	autoremove: '-5 seconds'        # how old emails are purged
	hideEmpty: yes                  # hide bar icon when no emails?
	debugger: yes                   # enable Tracy bar
	tempDir: '%tempDir/mails'       # change e-mails store directory

Manual setup

Replace the Nette's default IMailer service and register Tracy bar panel:

services:
	mail.mailer: RM\FileMailer(%tempDir%/mails)

	mailerPanel:
		class: RM\MailPanel
		autowired: no
		setup:
			- setFileMailer(@mail.mailer)	# required
			- $newMessageTime('-5 seconds')
			- $show([subject, from, to])
			- $autoremove('-5 seconds')
			- $hideEmpty(yes)

tracy:
	bar:
		- @mailerPanel
You can’t perform that action at this time.