Componette

Componette

nextras

nextras / mail-panel v2.6.2

Mail panel for Nette framework

download-cloud-line composer require nextras/mail-panel

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\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.

  • v2.6.2 2.6.2

    What's Changed

    Full Changelog: v2.6.1...v2.6.2

  • v2.6.1 2.6.1

    • fix internal issue - missing default value for argument-less link
  • v2.6.0 2.6.0

    • add support for Latte 3
    • remove deprecated SessionMailer
  • v2.5.3 2.5.3

    allowed PHP 8 in composer

  • v2.5.2 2.5.2

  • v2.5.0 2.5.0

    • added support for Nette 3.0
    • added tests
    • used strict types

    Thanks to @trejjam and @SendiMyrkr

    See full commit changelog.

  • v2.4.0 2.4.0

    Minor version 2.4.0 is out! 🍈 What's new?

    • added support for PHP 7.2 (thanks @dada-amater)
    • updated dependencies to Nette 2.4 and PHP 5.6
    • MailPanel expects Nette\Http\IRequest (thanks @MartkCz)

    See full commit changelog.

  • v2.3.0 Nextras Mail Panel 2.3.0

    • redesigned panel
    • added support for viewing attachments (thx @MartkCz)
    • added support for viewing mail source code (thx @repli2dev)
    • added support for viewing mail in new window (thx @repli2dev)
    • added plain text preview as alternative to HTML preview
    • added detection of optimal HTML preview height
    • previews are collapsed by default and their visibility state can be toggled
    • replaced PNG icon with SVG (thx @irkallacz)
    • increased default message count to 20
    • changed panel width in window-mode to fluid
    • deprecated SessionMailer in favor of FilesMailer
    • fixed baseUrl detection
    • fixed viewing of plain text-only mails with attachments (thx @repli2dev)
    • fixed possible redirect loop
    • lots of internal refactoring

  • v2.3.0-beta1 Mail Panel 2.3.0 beta

    • redesigned panel
    • added support for viewing attachments (thx @MartkCz)
    • added support for viewing mail source code (thx @repli2dev)
    • added support for viewing mail in new window (thx @repli2dev)
    • added plain text preview as alternative to HTML preview
    • added detection of optimal HTML preview height
    • previews are collapsed by default and their visibility state can be toggled
    • replaced PNG icon with SVG (thx @irkallacz)
    • deprecated SessionMailer in favor of FilesMailer
    • fixed baseUrl detection
    • fixed viewing of plain text-only mails with attachments (thx @repli2dev)
    • lots of internal refactoring

Componette Componette felix@nette.org