Starting to add email sending
This commit is contained in:
parent
b801f0dc19
commit
900bcb16d5
16 changed files with 248 additions and 21 deletions
14
app/controllers/admin/emails_controller.rb
Normal file
14
app/controllers/admin/emails_controller.rb
Normal 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
|
||||
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue