3

Is there a Drush command to disable email notifications about Module updates.

8

You can turn off just the email notify feature like this:

drush vdel update_notify_emails

(See in update.fetch.inc: $notify_list = variable_get('update_notify_emails', '');)

You might also want to consider the following alternative:

drush pm-disable update

This will completely disable the update module on your live server, which will also disable email notifications about Module updates. At first blush, you might be sad that you won't be able to see the module updates page on your live server any more; however, you should really be doing your updating on a development machine anyway, so you can just re-enable update on the dev server.

To automatically re-enable the update module every time you sql-sync from live to dev, see symc_enable.drush.inc.

Finally, to insure that your dev machine does not send out unwanted email notifications, enable the devel module, and then add to your settings.php file:

$conf['mail_system'] = array(
  'default-system' => 'DevelMailLog',
);
$conf['devel_debug_mail_directory'] = '/path/to/dir/to/save/email';

Then, devel will intercept all email that is sent and write it into the target directory instead of emailing it.

  • 1
    Cool, does that conf var for emails work without having to set $conf['mail_system'] to DevelMailLog? – Clive Dec 19 '13 at 19:14
  • 1
    Oops, thanks, I forgot that step. I'll go edit the answer. – greg_1_anderson Dec 19 '13 at 19:22
  • It worked with an error Warning: implode() [function.implode]: Invalid arguments passed in update_settings() (line 38 of /home/xxxxx/public_html/modules/update/update.settings.inc). – Fahad Dec 19 '13 at 19:59
  • Sorry, update module was not consistent in its use of that variable. I updated my answer. – greg_1_anderson Dec 19 '13 at 20:14
2

No, unless you installed a module that provides functionality to disable email notifications about Module updates, and drush command to switch it (or at least configuration in variable that can be easily changed with drush).

There is no such option in Drupal Core as far as I can remember.

  • 2
    I guess one option would be turn the module off altogether, but apart from that I think hook_mail_alter() is the only option in a custom module – Clive Dec 19 '13 at 19:09
  • I was actually thinking that there might be a configuration variable that can be set through vset command – Fahad Dec 19 '13 at 19:11
  • @Fahad The settings page is at /admin/reports/updates/settings, there doesn't seem to be a kill switch there – Clive Dec 19 '13 at 19:13
  • 1
    @Clive Just noticed if we remove email address from E-mail addresses from /admin/reports/updates/settings page it will not send any notifications. May be email field can be set blank through vset – Fahad Dec 19 '13 at 19:41
  • 1
    I looked up the variable name in update.fetch.inc; see answer below. – greg_1_anderson Dec 19 '13 at 19:44

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.