Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Send emails to var/tmp/mail in development
- Loading branch information
Showing
1 changed file
with
12 additions
and
0 deletions.
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 |
---|---|---|
@@ -1,5 +1,17 @@ | ||
use strict; | ||
use warnings; | ||
|
||
use FindBin; | ||
use lib "$FindBin::RealBin/lib"; | ||
|
||
if ( $ENV{PLACK_ENV} eq 'development' ) { | ||
|
||
# In development send emails to a directory. | ||
if ( !$ENV{EMAIL_SENDER_TRANSPORT} ) { | ||
$ENV{EMAIL_SENDER_TRANSPORT} = 'Maildir'; | ||
$ENV{EMAIL_SENDER_TRANSPORT_dir} = "$FindBin::RealBin/var/tmp/mail"; | ||
} | ||
} | ||
|
||
# The class has the Plack initialization and returns the app. | ||
require MetaCPAN::Server; |