Disable dashboard email deliveries

We have to doble check all emails deliveries from the dashboard.

Using a setting to skip all dashboard email deliveries for now.

Note that a rake task to activated the `Setting["dashboard.emails"]` will need to be addded when we want to activate deliveries of these emails.
This commit is contained in:
voodoorai2000
2019-04-23 14:34:33 +02:00
committed by decabeza
parent 6f3b213612
commit e139057001
4 changed files with 89 additions and 1 deletions

View File

@@ -1,5 +1,6 @@
class Dashboard::Mailer < ApplicationMailer
layout "mailer"
after_action :check_deliverability
def forward(proposal)
@proposal = proposal
@@ -38,4 +39,9 @@ class Dashboard::Mailer < ApplicationMailer
def get_new_actions(new_actions_ids)
Dashboard::Action.where(id: new_actions_ids)
end
def check_deliverability
mail.perform_deliveries = false unless Setting["dashboard.emails"]
end
end