diff --git a/bounces.php b/bounces.php index 0a02f0c..e8c3688 100644 --- a/bounces.php +++ b/bounces.php @@ -25,6 +25,7 @@ */ use core_reportbuilder\system_report_factory; +use tool_emailutils\helper; use tool_emailutils\reportbuilder\local\systemreports\email_bounces; require(__DIR__.'/../../../config.php'); @@ -35,6 +36,17 @@ echo $OUTPUT->header(); echo $OUTPUT->heading(get_string('reportbounces', 'tool_emailutils')); +// Render config used for calculating bounce threshold. +[$handlebounces, $minbounces, $bounceratio] = helper::get_bounce_config(); +if (empty($handlebounces)) { + echo $OUTPUT->notification(get_string('configmissing', 'tool_emailutils')); +} else { + echo $OUTPUT->notification(get_string('bounceconfig', 'tool_emailutils', [ + 'minbounces' => $minbounces, + 'bounceratio' => $bounceratio, + ]), 'info'); +} + $report = system_report_factory::create(email_bounces::class, context_system::instance()); echo $report->output(); diff --git a/lang/en/tool_emailutils.php b/lang/en/tool_emailutils.php index c764cd2..01cf50f 100644 --- a/lang/en/tool_emailutils.php +++ b/lang/en/tool_emailutils.php @@ -32,6 +32,7 @@ $string['aws_secret_desc'] = 'Your AWS Secret Access Key'; $string['bouncecheckfull'] = 'Are you absolutely sure you want to reset the bounce count for {$a} ?'; $string['bouncecount'] = 'Bounce count'; +$string['bounceconfig'] = 'Bounce handling is enabled. Emails will not be sent to addresses with over {$a->minbounces} bounces and a bounce ratio above {$a->bounceratio}. These values can be changed in config.php.'; $string['bounceratio'] = 'Bounce ratio'; $string['bounces'] = 'For a list of bounces, visit {$a} and search for emails ending with ".b.invalid."'; $string['bouncesreset'] = 'Bounces have been reset for the selected users'; @@ -43,7 +44,7 @@ $string['checkdnspostmastertools'] = 'Check Post master tools'; $string['checkdnsspf'] = 'DNS Email SPF check'; $string['complaints'] = 'For a list of complaints, search for ".c.invalid"'; -$string['configmissing'] = 'Missing config.php setting ($CFG->handlebounces) please review config-dist.php for more information.'; +$string['configmissing'] = 'Bounce handling is not enabled as $CFG->handlebounces is not set. Please review config-dist.php for more information.'; $string['dkimmanager'] = 'SPF & DKIM manager'; $string['dkimmanagerhelp'] = '

This shows all DKIM key pairs / selectors available for email signing, including those made by this admin tool or put in place by external tools such as open-dkim. For most systems this is the end to end setup:

    diff --git a/version.php b/version.php index 2cfa09f..8535166 100644 --- a/version.php +++ b/version.php @@ -25,8 +25,8 @@ defined('MOODLE_INTERNAL') || die(); -$plugin->version = 2024111301; -$plugin->release = 2024111301; +$plugin->version = 2024111400; +$plugin->release = 2024111400; $plugin->requires = 2024042200; $plugin->component = 'tool_emailutils'; $plugin->maturity = MATURITY_STABLE;