hook_cron() runs even if 'mail.use_cron' config is disabled

Created on 21 July 2025, 6 days ago

Problem/Motivation

While debugging the simplenews_cron() implementation, I noticed that it ignores the 'mail.use_cron' configuration setting and proceeds to call sendSpool() unconditionally.

This behavior may appear harmless since the Mailer::attemptImmediateSend() method internally checks the same configuration. However, in certain custom setups where sending is exclusively managed via a Drush command (e.g., drush sn-ss), it’s important that the cron job does not initiate any sending behavior at all.

Expected behavior: if 'mail.use_cron' is set to FALSE, the hook_cron() implementation should respect that and avoid calling sendSpool() altogether.

πŸ› Bug report
Status

Active

Version

4.1

Component

Code

Created by

πŸ‡§πŸ‡·Brazil andre.bonon

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Production build 0.71.5 2024