Skip to content
Snippets Groups Projects
Commit 362d1869 authored by Lucas Hedding's avatar Lucas Hedding Committed by Lucas Hedding
Browse files

Issue #3075524 by heddn: Honour 'notification' toggle for emails

parent 0994c72a
No related branches found
No related tags found
No related merge requests found
...@@ -109,6 +109,10 @@ class Notify implements NotifyInterface { ...@@ -109,6 +109,10 @@ class Notify implements NotifyInterface {
* {@inheritdoc} * {@inheritdoc}
*/ */
public function send() { public function send() {
// Don't send mail if notifications are disabled.
if (!$this->configFactory->get('automatic_updates.settings')->get('notify')) {
return;
}
$messages = $this->automaticUpdatesPsa->getPublicServiceMessages(); $messages = $this->automaticUpdatesPsa->getPublicServiceMessages();
if (!$messages) { if (!$messages) {
return; return;
......
{# {#
/** /**
* @file * @file
* Template for the public service annoucements email notification. * Template for the public service announcements email notification.
* *
* Available variables: * Available variables:
* - messages: The messages array * - messages: The messages array
...@@ -27,7 +27,9 @@ ...@@ -27,7 +27,9 @@
<li>{{ message }}</li> <li>{{ message }}</li>
{% endfor %} {% endfor %}
</ul> </ul>
<p>To see all PSAs, visit <a href="https://www.drupal.org/security/psa" target="_blank">https://www.drupal.org/security/psa</a>.</p> <p>
{{ 'To see all PSAs, visit <a href="@uri">@uri</a>.'|t({'@uri': 'https://www.drupal.org/security/psa'}) }}
</p>
<p> <p>
{% set settings_link = path('automatic_updates.settings') %} {% set settings_link = path('automatic_updates.settings') %}
{% trans %} {% trans %}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment