From 05392701a981f87af3cb756cd20c49e10bc79837 Mon Sep 17 00:00:00 2001 From: Chrisbr Date: Tue, 13 May 2014 14:50:29 +0200 Subject: [PATCH] Send registration mail only if email settings true --- app/controllers/conference_registration_controller.rb | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/app/controllers/conference_registration_controller.rb b/app/controllers/conference_registration_controller.rb index 5df877e2..21928fb4 100644 --- a/app/controllers/conference_registration_controller.rb +++ b/app/controllers/conference_registration_controller.rb @@ -74,7 +74,9 @@ class ConferenceRegistrationController < ApplicationController if update_registration redirect_message = "Registration updated." else - Mailbot.registration_mail(conference, current_user.person).deliver + if conference.email_settings.send_on_registration? + Mailbot.registration_mail(conference, current_user.person).deliver + end end redirect_to(register_conference_path(:id => conference.short_title), :notice => redirect_message) end