rm / filemailer
Addon for catching e-mails in Nette FW to filesystem and showing it in the Debug Bar.
Installs: 11 427
Dependents: 0
Suggesters: 0
Security: 0
Stars: 5
Watchers: 6
Forks: 3
Open Issues: 0
Requires
- php: >=5.3.0
- latte/latte: >=2.2
- nette/application: >=2.2
- nette/caching: >=2.2
- nette/http: >=2.2
- nette/mail: >=2.2
- nette/utils: >=2.2
README
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.
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