Giter Site home page Giter Site logo

mail-panel's Introduction

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('[email protected]', 'John Doe');
		$mail->addTo('[email protected]');
		$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.

mail-panel's People

Contributors

adawolfa avatar ciki avatar dada-amater avatar enumag avatar gappa avatar hrach avatar irkallacz avatar janmarek avatar jantvrdik avatar mabar avatar o5 avatar paveljurasek avatar radimvaculik avatar sendimyrkr avatar trejjam avatar unlink avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

mail-panel's Issues

Clarify documentation

The first line of the documentation, the part "[...] captures sent e-mails in development mode [...]" is misleading. Mails are always captured, just not shown in production.

I don't mind leaving MailPanel out in config.local on a production machine. Merely from this documentation I wrongly assumed this would let mails pass normally in procution mode.

Thanks @JanTvrdik , great component!

Plain text mail with attachment: empty text

When sending plain text mail ($mail->setBody('Some message')) together with attachment then the shown text in mail panel is empty.

From small insight the Message class behave strange. After composing message the text is in the $message->body, however in in mail panel they come with two items in $message->parts and empty $message->body.

composer dependency compatibility with nette 2.1

i wanted to get this repo through composer but i couldn't because of this message:

Your requirements could not be resolved to an installable set of packages.

  Problem 1
    - Installation request for nette/nette v2.1.0-RC1 -> satisfiable by nette/nette[v2.1.0-RC1].
    - nextras/mail-panel dev-master requires nette/nette 2.0.* | 2.1 -> satisfiable by nette/nette[v2.0.10, v2.0.11, v2.0.12, v2.0.13, v2.0.2, v2.0.3, v2.0.4, v2.0.5, v2.0.6, v2.0.7, v2.0.8, v2.0.9], nette/nette-minified[v2.0.10, v2.0.11, v2.0.12, v2.0.13].
    - Can only install one of: nette/nette[v2.1.0-RC1, v2.0.10].
    - Can only install one of: nette/nette[v2.1.0-RC1, v2.0.11].
    - Can only install one of: nette/nette[v2.1.0-RC1, v2.0.12].
    - Can only install one of: nette/nette[v2.1.0-RC1, v2.0.13].
    - Can only install one of: nette/nette[v2.1.0-RC1, v2.0.2].
    - Can only install one of: nette/nette[v2.1.0-RC1, v2.0.3].
    - Can only install one of: nette/nette[v2.1.0-RC1, v2.0.4].
    - Can only install one of: nette/nette[v2.1.0-RC1, v2.0.5].
    - Can only install one of: nette/nette[v2.1.0-RC1, v2.0.6].
    - Can only install one of: nette/nette[v2.1.0-RC1, v2.0.7].
    - Can only install one of: nette/nette[v2.1.0-RC1, v2.0.8].
    - Can only install one of: nette/nette[v2.1.0-RC1, v2.0.9].
    - don't install nette/nette-minified v2.0.10|don't install nette/nette v2.1.0-RC1
    - don't install nette/nette-minified v2.0.11|don't install nette/nette v2.1.0-RC1
    - don't install nette/nette-minified v2.0.12|don't install nette/nette v2.1.0-RC1
    - don't install nette/nette-minified v2.0.13|don't install nette/nette v2.1.0-RC1
    - Installation request for nextras/mail-panel dev-master -> satisfiable by nextras/mail-panel[dev-master].

my composer.json:

"require": {
        "nette/nette": "v2.1.0-RC1",
        "nextras/mail-panel": "dev-master"

Allow IMailer service replacement

By using the recommended configuration

services:
    nette.mailer: Nextras\MailPanel\FileMailer(%tempDir%/mail-panel-mails)

The following code will fail

$container->removeService('nette.mailer');
$container->addService('nette.mailer', Mockery::mock(IMailer::class));

AFAIK the only possible solution is to change MailPanel typehint from IPersistentMailer to IMailer and ignore the mailer when not instance of IPersistentMailer. Also the configuration would need to be changed to

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

Call to undefined method Nette\Templating\FileTemplate::safeurl()

when i am trying to use this with nette 2.1 stable, actually it throws:

User Error

Exception in Nette\Templating\Template::__toString(): Call to undefined method Nette\Templating\FileTemplate::safeurl(). in /Users/rixite/Sites/tvfort/vendor/nette/nette/Nette/common/ObjectMixin.php:99 

not sure if affected by this or something else

Nette/mail v 4.0.0 error: Property Nette\Mail\Message::$subject is deprecated, use Nette\Mail\Message::getSubject() method

Hi,

When I upgraded Nette from 3.1 to 4.0 (nette/mail v 4.0.0), Nextras panel 2.6.x-dev isn't working:
ErrorException: Property Nette\Mail\Message::$subject is deprecated, use Nette\Mail\Message::getSubject() method

Problem is with nette/mail v4.0.0 and nextras/mail-panel 2.6.x-dev.
When I'm using nette/mail 3.1.10 and nextras/mail-panel 2.6.x-dev, Nextras panel is working fine.

Allow PHP 8.0

I'm using this library with PHP 8 and it seems to work correctly.

Remove Nette\Object

Please abandon use of Nette\Object and switch to trait Nette\SmartObject.
Extension becomes incompatible with latest nette.

Sorry for not sending a PR, being at work right now ;-)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.