Skip to content

irkallacz/mail-panel

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

49 Commits
 
 
 
 
 
 
 
 

Repository files navigation

MailPanel

Nette Debug panel for sent emails. Supports storing emails into

  • files
  • session

Based on http://git.yavanna.cz/p/mailpanel/ by Jan Drábek.

Installation

Install library via composer:

composer require nextras/mail-panel

Mailer has to be set as service "nette.mailer" in development configuration.

services:
	nette.mailer: Nextras\MailPanel\FileMailer(%tempDir%/mails)
#   nette.mailer: Nextras\MailPanel\SessionMailer

Add MailPanel to debug bar:

tracy:
	bar:
		- Nextras\MailPanel\MailPanel(%tempDir%)

Usage

Messages has to be sent by injected mailer or created by Nette mail factory.

class ExamplePresenter extends BasePresenter
{

	private $mailer;

	public function injectMailer(Nette\Mail\IMailer $mailer)
	{
		$this->mailer = $mailer;
	}

	public function renderDefault()
	{
		$mail = new Nette\Mail\Message;
		$mail->setFrom('[email protected]');
		$mail->addTo('[email protected]');
		$mail->setSubject('Subject');
		$mail->setBody('Message body');

		$this->mailer->send($mail);
	}

}

About

Mail panel for Nette framework

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages

  • PHP 70.3%
  • HTML 29.7%