kalamuna / drupal-project

Kalamuna composer template for Drupal projects with CircleCI and Pantheon integration. (NOTE: THIS SHOULD NOT BE USED FOR NEW DRUPAL 9 SITES)
GNU General Public License v2.0
6 stars 1 forks source link

Disabling email when not in live #80

Closed mikemccaffrey closed 4 years ago

mikemccaffrey commented 4 years ago

We should decide on the best method to prevent/reroute emails on dev sites, to make sure they don't get sent out to the clients/users.

The easiest method seems like it would be to add this to our default.settings.local.php:

  $conf['mail_system'] = array(
    'default-system' => 'DevelMailLog',
  );

However, would we also want to make sure pantheon environments other than the live site can't send out emails? Should we append this to settings.php so it works for both local and pantheon sites?

if (!isset($_ENV['PANTHEON_ENVIRONMENT']) || $_ENV['PANTHEON_ENVIRONMENT'] !== 'live') {
  $conf['mail_system'] = array(
    'default-system' => 'DevelMailLog',
  );
}
mikemccaffrey commented 4 years ago

Okay, this will now be appended to the settings.php.