My Blog Posts

Laravel Mail Viewer

Laravel Mail Viewer


Design and content team members often need access to emails that your app sends to users. This is a fairly simple package that makes it possible and tries to minimize the developer's addiction. Using this package, you may have a custom route to display all your posts in one place. Having shareable URLs to view emails makes team coordination more smooth.

I find this idea clean for developers, too, because I'm always looking at test emails to check email, and this package gives you the perfect way to apply for all of them in one place.

The configuration accepts all mail that you want to appear; this means that all new emails that you want to add must explicitly identify them. You can also restrict access to accessible mail in the environment.


configuration file:

return [ /* |-------------------------------------------------------------------------- | Only the mailables registered here can be accessed using this package |-------------------------------------------------------------------------- | | You have to add the mailables including their dependencies | In the following array. When asked for an emailable, the | package will search it here for its definition. | | Eg: [ new OrderShipped(factory(Order::class)-create()] ] | */ 'mailables' => [], /* |-------------------------------------------------------------------------- | URL where you want to view the mails |-------------------------------------------------------------------------- | | This is the URL where you can view all the | mailables registered above. | */ 'url' => 'mails', /* |-------------------------------------------------------------------------- | The environments in which the url should be accessible |-------------------------------------------------------------------------- | | If you don't want to use this package in production env | at all, you can restrict that using this option | rather than using a middleware. | */ 'allowed_environments' => ['local', 'staging', 'testing'], /* |-------------------------------------------------------------------------- | Middlewares that should be applied to the URL |-------------------------------------------------------------------------- | | The value should be an array of fully qualified | class names of the middleware classes. | | Eg: [Authenticate::class, CheckForMaintenanceMode::class] | Don't forget to import the classes at the top! | */ 'middlewares' => [], ];

JoggApp / laravel-mail-viewer You can access the Laravel Mail Viewer source code and setup instructions on GitHub 



Share this article


Comments (0)

Comment