- 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.'); } }
- πΊπΈUnited States goose2000
I appreciate that @ultrabob ! People I work for at first just want it turned off, but I think with time, they will want this notification, understand it better.
Do think my post here is a duplicate :
https://www.drupal.org/project/commerce_license/issues/3327540#comment-1... β¨ Allow administrators to disable email notification sending on license expiration Needs reviewI have applied #9 patch and it works with the new - 3.0.2 Stable release released 25 June 2025