- Issue created by @goose2000
- π¬π§United Kingdom joachim
You can prevent a mail being sent with https://api.drupal.org/api/drupal/core%21core.api.php/function/hook_mail...
- π―π΅Japan ultrabob Japan
For anyone needing to do this, like I also did. Here is an example of the hook @joachim mentioned. I personally believe the module should provide options around whether these emails should be sent or not, but in the meantime, something like this should work:
/** * Implements hook_mail_alter(). * * Prevents Commerce License expiry notification emails from being sent. */ function mymodule_mail_alter(&$message) { // Intercept the license expiry notification email. if ($message['module'] === 'commerce_license' && $message['key'] === 'license_expire') { // Prevent the email from being sent. $message['send'] = FALSE; // Optionally log it. // \Drupal::logger('mymodule')->notice('Suppressed license expiry email.'); } }