Addon for catching e-mails in Nette FW to filesystem and showing it in the Debug Bar.
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.
- Simple instalation
- Extensive configuration options
- Full access to headers
- Plain text and HTML output
- Possibility to download the attachments
- Parser caching
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.
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.
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
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