Skip to content

Commit

Permalink
Merge pull request #11 from mikemand/patch-1
Browse files Browse the repository at this point in the history
Use configuration value for preview path.
  • Loading branch information
themsaid committed Apr 26, 2016
2 parents 3a5bca4 + 1cf8133 commit 19d5a24
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/MailPreviewServiceProvider.php
Expand Up @@ -29,9 +29,9 @@ public function boot()
$this->app['router']->group(['middleware' => $this->middleware()], function ($router) {
$router->get('/themsaid/mail-preview', function () {
if ($previewPath = $this->app['request']->input('path')) {
$content = file_get_contents(storage_path('email-previews/'.$previewPath.'.html'));
$content = file_get_contents($this->app['config']['mailpreview.path'].'/'.$previewPath.'.html');
} else {
$lastPreviewName = last(glob(storage_path('email-previews').'/*.html'));
$lastPreviewName = last(glob($this->app['config']['mailpreview.path'].'/*.html'));
$content = file_get_contents($lastPreviewName);
}

Expand Down Expand Up @@ -70,4 +70,4 @@ private function middleware()
[\Illuminate\Session\Middleware\StartSession::class]
);
}
}
}

0 comments on commit 19d5a24

Please sign in to comment.