Starting to add email sending

This commit is contained in:
Matt Barringer 2013-01-14 08:49:49 +01:00
parent b801f0dc19
commit 900bcb16d5
16 changed files with 248 additions and 21 deletions

View file

@ -0,0 +1,14 @@
class Admin::EmailsController < ApplicationController
before_filter :verify_organizer
layout "admin"
def update
@conference.email_settings.update_attributes(params[:email_settings])
redirect_to(admin_conference_email_settings_path(@conference.short_title), :notice => 'Settings have been successfully updated.')
end
def show
@settings = @conference.email_settings
end
end

View file

@ -13,6 +13,7 @@ class ConferenceRegistrationController < ApplicationController
end
end
# TODO this is ugly
def update
conference = Conference.find_all_by_short_title(params[:id]).first
person = current_user.person
@ -37,6 +38,8 @@ class ConferenceRegistrationController < ApplicationController
redirect_message = "You are now registered."
if update_registration
redirect_message = "Registration updated."
else
Mailbot.registration_mail(request.host_with_port, conference, current_user.person).deliver
end
redirect_to(register_conference_path(:id => conference.short_title), :notice => redirect_message)
end