Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

UHF-8945: disable email sending. #128

Merged
merged 4 commits into from
Sep 8, 2023
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions helfi_api_base.module
Original file line number Diff line number Diff line change
Expand Up @@ -50,3 +50,16 @@ function helfi_api_base_theme_suggestions_debug_item(array $variables) : array {
$suggestions[] = 'debug_item__' . strtr($variables['id'], '.', '_');
return $suggestions;
}

/**
* Implements hook_mail_alter().
*/
function helfi_api_base_mail_alter(&$message) : void {
$environmentResolver = \Drupal::service('helfi_api_base.environment_resolver');
try {
rpnykanen marked this conversation as resolved.
Show resolved Hide resolved
$environmentResolver->getActiveEnvironment();
$message['send'] = FALSE;
}
catch (\InvalidArgumentException) {
}
}
Loading