Skip to content
Mail panel for Nette framework
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.
doc/assets rewritten readme, added more explicit license May 1, 2016
src fix issues found by phpstan May 1, 2019
tests
.gitignore typo May 1, 2019
.travis.yml ci: run tester May 1, 2019
composer.json
license.md
phpstan.neon
readme.md MailPanel: changed $mailer typehint in constructor to IMailer Jun 8, 2016

readme.md

Nextras Mail Panel

Downloads this Month Stable version

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

  1. Install library via composer:

    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.

    tracy:
    	bar:
    		- Nextras\MailPanel\MailPanel(%tempDir%/mail-panel-latte)
    
    services:
    	nette.mailer:
    		class: Nette\Mail\IMailer
    		factory: Nextras\MailPanel\FileMailer(%tempDir%/mail-panel-mails)

Usage

Messages has to be sent by injected instance of Nette\Mail\IMailer.

class ExamplePresenter extends BasePresenter
{
	/** @var Nette\Mail\IMailer @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.

You can’t perform that action at this time.