nextras / mail-panel
MailPanel is extension for Nette Framework which captures sent e-mails in development mode and shows them in debugger bar.
Installs: 977 467
Dependents: 7
Suggesters: 0
Security: 0
Stars: 72
Watchers: 12
Forks: 19
Open Issues: 3
Requires
- php: ~7.1 || ~8.0
- latte/latte: ~2.6 || ~3.0
- nette/http: ~3.0
- nette/mail: ~3.1 || ~4.0
- nette/utils: ~3.0 || ~4.0
- tracy/tracy: ~2.4
Requires (Dev)
- mockery/mockery: ~1.3.3
- nette/tester: ~2.0
- phpstan/phpstan: 1.4.10
This package is auto-updated.
Last update: 2024-12-08 10:21:15 UTC
README
Nextras Mail Panel is an extension for Nette Framework which captures sent e-mails in development mode and shows them in Tracy bar.
Screenshot
Installation
-
Install library via composer:
composer require nextras/mail-panel
-
Update your local configuration (e.g.
config.local.neon
) to register Mail Panel to Tracy
and to change default mailer toNextras\MailPanel\FileMailer
.tracy: bar: - Nextras\MailPanel\MailPanel(%tempDir%/mail-panel-latte) services: nette.mailer: class: Nette\Mail\Mailer factory: Nextras\MailPanel\FileMailer(%tempDir%/mail-panel-mails)
Usage
Messages has to be sent by injected instance of Nette\Mail\Mailer
.
class ExamplePresenter extends BasePresenter { /** @var Nette\Mail\Mailer @inject */ public $mailer; public function actionSendMail() { $mail = new Nette\Mail\Message(); $mail->setFrom('john.doe@example.com', 'John Doe'); $mail->addTo('jack@example.com'); $mail->setSubject('Order Confirmation'); $mail->setHtmlBody('Hello Jack,<br>Your order has been accepted.'); $this->mailer->send($mail); } }
License
Based on MailPanel by Jan Drábek.
New BSD License. See full license.