Skip to content

Commit

Permalink
UHF-8945: added comment, unecesary use of variable
Browse files Browse the repository at this point in the history
  • Loading branch information
rpnykanen committed Sep 8, 2023
1 parent 578b633 commit d825bc2
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions helfi_api_base.module
Original file line number Diff line number Diff line change
Expand Up @@ -55,9 +55,11 @@ function helfi_api_base_theme_suggestions_debug_item(array $variables) : array {
* Implements hook_mail_alter().
*/
function helfi_api_base_mail_alter(&$message) : void {
$environmentResolver = \Drupal::service('helfi_api_base.environment_resolver');
// Prevent sending an email if current site/environment is unknown to the resolver.
// Only helfi-drupal sites are affected by this change.
try {
$environmentResolver->getActiveEnvironment();
\Drupal::service('helfi_api_base.environment_resolver')
->getActiveEnvironment();
$message['send'] = FALSE;
}
catch (\InvalidArgumentException) {
Expand Down

0 comments on commit d825bc2

Please sign in to comment.