Skip to content

Commit fb40d67

Browse files
committed
Enable mailhog by default if dev/local
Signed-off-by: Riddhesh Sanghvi <riddhesh237@gmail.com>
1 parent 8e4339e commit fb40d67

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

src/WordPress.php

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1069,6 +1069,12 @@ private function create_site( $assoc_args ) {
10691069
$cron_interval = rand( 0, 9 );
10701070
\EE::runcommand( 'cron create ' . $this->site_data['site_url'] . " --user=www-data --command='wp cron event run --due-now' --schedule='$cron_interval/10 * * * *'" );
10711071

1072+
$env_type = \EE::get_runner()->config['env'];
1073+
if ( ! empty( $env_type ) && in_array( $env_type, [ 'develop', 'development', 'local' ] ) ) {
1074+
\EE::log( 'Enabling mailhog as this is a ' . $env_type . ' server.' );
1075+
\EE::runcommand( 'mailhog enable ' . $this->site_data['site_url'] );
1076+
}
1077+
10721078
$this->info( [ $this->site_data['site_url'] ], [] );
10731079
}
10741080

0 commit comments

Comments
 (0)