-
-
Notifications
You must be signed in to change notification settings - Fork 81
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
update readme and change default preview path
- Loading branch information
Showing
3 changed files
with
80 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
# The MIT License (MIT) | ||
|
||
Copyright (c) 2015 Mohamed Said <[email protected]> | ||
|
||
> Permission is hereby granted, free of charge, to any person obtaining a copy | ||
> of this software and associated documentation files (the "Software"), to deal | ||
> in the Software without restriction, including without limitation the rights | ||
> to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
> copies of the Software, and to permit persons to whom the Software is | ||
> furnished to do so, subject to the following conditions: | ||
> | ||
> The above copyright notice and this permission notice shall be included in | ||
> all copies or substantial portions of the Software. | ||
> | ||
> THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
> IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
> FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
> AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
> LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
> OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN | ||
> THE SOFTWARE. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
# Laravel Mail Preview Driver | ||
|
||
[](https://packagist.org/packages/themsaid/laravel-mail-preview) | ||
[](LICENSE.md) | ||
[](https://packagist.org/packages/themsaid/laravel-mail-preview) | ||
|
||
This package introduces a new `preview` mail driver for laravel, when selected it will produce the output of the | ||
sent emails and save it as HTML documents for you to check in a web browser. | ||
|
||
## Installation | ||
|
||
Begin by installing the package through Composer. Run the following command in your terminal: | ||
|
||
```bash | ||
composer require themsaid/laravel-mail-preview | ||
``` | ||
|
||
Once composer is done, add the package service provider in the providers array in `config/app.php`: | ||
|
||
```php | ||
Themsaid\MailPreview\MailPreviewServiceProvider::class | ||
``` | ||
|
||
Finally publish the config file: | ||
|
||
``` | ||
php artisan vendor:publish | ||
``` | ||
|
||
That's all, you only need to change the `MAIL_DRIVER` environment variable in the `.env` file to become `preview`. | ||
|
||
## How it works | ||
|
||
On every email sent a HTML document will be generated in `storage/email-previews` with a name that includes the first receiver and the subject: | ||
|
||
``` | ||
1457904864_jack_at_gmail_com_invoice_000234.html | ||
``` | ||
|
||
When opened in a web browser you'll be able to see how your email will look like, however there might be some differences that varies from | ||
an email client to another. | ||
|
||
At the beginning of the generated file you'll find a HTML comment with all the message info: | ||
|
||
```html | ||
<!-- | ||
From:{"[email protected]":"Acme HQ"}, | ||
to:{"[email protected]":"Jack Black"}, | ||
reply-to:"[email protected]", | ||
cc:[{"[email protected]":"Acme Finance"}, {"[email protected]":"Acme Management"}], | ||
bcc:null, | ||
subject:Invoice #000234 | ||
--> | ||
``` | ||
|
||
## Package Configurations | ||
From the configuration file you'll be able to change the previews output location as well as the maximum life time for | ||
keeping previews, after this time old previews will get removed. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters