https://github.com/nextras/mail-panel
Mail panel for Nette framework
https://github.com/nextras/mail-panel
mail-panel nette-component nextras php tracy tracy-panel
Last synced: about 1 year ago
JSON representation
Mail panel for Nette framework
- Host: GitHub
- URL: https://github.com/nextras/mail-panel
- Owner: nextras
- License: other
- Created: 2013-09-04T21:04:54.000Z (almost 13 years ago)
- Default Branch: master
- Last Pushed: 2023-09-08T07:32:24.000Z (almost 3 years ago)
- Last Synced: 2025-04-11T01:17:54.397Z (about 1 year ago)
- Topics: mail-panel, nette-component, nextras, php, tracy, tracy-panel
- Language: PHP
- Homepage: https://nextras.org/mail-panel
- Size: 181 KB
- Stars: 72
- Watchers: 11
- Forks: 19
- Open Issues: 3
-
Metadata Files:
- Readme: readme.md
- License: license.md
Awesome Lists containing this project
README
# Nextras Mail Panel
[](https://packagist.org/packages/nextras/mail-panel)
[](https://packagist.org/packages/nextras/mail-panel)
Nextras Mail Panel is an extension for [Nette Framework](https://nette.org) which captures sent e-mails in development mode and shows them in [Tracy](https://tracy.nette.org) bar.
### Screenshot

### Installation
1. Install library via composer:
```bash
composer require nextras/mail-panel
```
2. Update your local configuration (e.g. `config.local.neon`) to register Mail Panel to Tracy
and to change default mailer to `Nextras\MailPanel\FileMailer`.
```neon
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`.
```php
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,
Your order has been accepted.');
$this->mailer->send($mail);
}
}
```
### License
*Based on [MailPanel by Jan Drábek](https://packagist.org/packages/jandrabek/nette-mailpanel).*
New BSD License. See full [license](license.md).