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.

Issue fork simplenews-3537254

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

andre.bonon created an issue. See original summary.

andre.bonon’s picture

Status: Active » Needs review

adamps made their first commit to this issue’s fork.

  • adamps committed b73e35ac on 4.x authored by andre.bonon
    fix: #3537254 hook_cron() runs even if 'mail.use_cron' config is...
adamps’s picture

Status: Needs review » Fixed

Thanks

Now that this issue is closed, review the contribution record.

As a contributor, attribute any organization that helped you, or if you volunteered your own time.

Maintainers, credit people who helped resolve this issue.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.