From 740e1dcfe8592690a80691e1ffaf9563c93e2173 Mon Sep 17 00:00:00 2001 From: Martin Edenhofer Date: Tue, 24 May 2016 09:41:22 +0200 Subject: [PATCH] Disabled email notifications if developer_mode is enabled. --- app/models/channel.rb | 5 +++++ .../ticket/article/communicate_email/background_job.rb | 3 --- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/app/models/channel.rb b/app/models/channel.rb index a973cd01d..945643fdf 100644 --- a/app/models/channel.rb +++ b/app/models/channel.rb @@ -206,6 +206,11 @@ send via account def deliver(mail_params, notification = false) + # ignore notifications in developer mode + if notification == true && Setting.get('developer_mode') == true + logger.notice "Do not send notification #{mail_params.inspect} because of enabled developer_mode" + end + adapter = options[:adapter] adapter_options = options if options[:outbound] && options[:outbound][:adapter] diff --git a/app/models/observer/ticket/article/communicate_email/background_job.rb b/app/models/observer/ticket/article/communicate_email/background_job.rb index 6634be4fb..9c30050ce 100644 --- a/app/models/observer/ticket/article/communicate_email/background_job.rb +++ b/app/models/observer/ticket/article/communicate_email/background_job.rb @@ -28,9 +28,6 @@ class Observer::Ticket::Article::CommunicateEmail::BackgroundJob sender = Ticket::Article::Sender.lookup(id: record.sender_id) if sender['name'] == 'System' notification = true - - # ignore notifications in developer mode - return if Setting.get('developer_mode') == true end # get linked channel and send