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

@ -23,4 +23,8 @@
- if activated == "Event Types"
%li.active= link_to "Event Types", "#"
- else
%li= link_to "Event Types", admin_conference_eventtype_list_path(@conference.short_title)
%li= link_to "Event Types", admin_conference_eventtype_list_path(@conference.short_title)
- if activated == "Emails"
%li.active= link_to "Emails", "#"
- else
%li= link_to "Emails", admin_conference_email_settings_path(@conference.short_title)

View file

@ -0,0 +1,50 @@
.container-fluid
.row-fluid
.span3
= render 'admin/conference/sidebar', :activated => "Emails"
.span9
= link_to "Template Help", "#", :id => "template-help-link"
#template-help
Valid attributes:
%table.table
%tr
%td {email}
%td The user's email address
%tr
%td {name}
%td The user's full name
%tr
%td {conference}
%td The full conference title
%tr
%td {proposalslink}
%td A link to the user's proposal page
%tr
%td {registrationlink}
%td A link to the registration page
%tr
%td {eventtitle}
%td The title of an accepted or rejected proposal
= semantic_form_for(@settings, :url => admin_conference_email_settings_path(@conference.short_title),:html => {:multipart => true}) do |f|
= f.input :send_on_registration, :label => false, :hint => "Send an email when the user registers for the conference?"
= f.input :registration_subject
= f.input :registration_email_template, :input_html => { :rows => 10, :cols => 20}
= f.input :send_on_accepted, :label => false, :hint => "Send an email when the proposal is accepted?"
= f.input :accepted_subject
= f.input :accepted_email_template, :input_html => { :rows => 10, :cols => 20 }
= f.input :send_on_rejected, :label => false, :hint => "Send an email when the proposal is rejected?"
= f.input :rejected_subject
= f.input :rejected_email_template, :input_html => { :rows => 10, :cols => 20 }
= f.input :send_on_confirmed_without_registration, :label => false, :hint => "Send an email when a user has a confirmed proposal, but isn't yet registered?"
= f.input :confirmed_without_registration_subject
= f.input :confirmed_email_template, :input_html => { :rows => 10, :cols => 20 }
= f.action :submit, :as => :button, :button_html => {:class => "btn btn-primary"}
:javascript
$(document).ready( function() {
$("#template-help").hide();
$("#template-help-link").click(function() {
$("#template-help").toggle();
});
});

View file

@ -22,21 +22,26 @@
= @event.state.humanize
<b class="caret"></b>
%ul.dropdown-menu
- if @event.transition_possible? :accept
%li= link_to "Accept event (no email)", update_state_admin_conference_event_path(@conference.short_title, @event, :transition => :accept, :send_mail => false),
- if event.transition_possible? :accept
%li= link_to "Accept event (no email)", update_state_admin_conference_event_path(@conference.short_title, event, :transition => :accept, :send_mail => false),
:method => :put, :hint => "Accept this event without sending an automated email."
- if @event.transition_possible? :reject
%li= link_to "Reject event (no email)", update_state_admin_conference_event_path(@conference.short_title, @event, :transition => :reject, :send_mail => false),
%li= link_to "Accept event (WITH email)", update_state_admin_conference_event_path(@conference.short_title, event, :transition => :accept, :send_mail => true),
:method => :put, :hint => "Accept this event and send an automated email."
- if event.transition_possible? :reject
%li= link_to "Reject event (no email)", update_state_admin_conference_event_path(@conference.short_title, event, :transition => :reject, :send_mail => false),
:method => :put, :confirm => "Are you sure?",
:hint => "Reject this event without sending an automated email."
- if @event.transition_possible? :start_review
%li= link_to "Start review", update_state_admin_conference_event_path(@conference.short_title, @event, :transition => :start_review),
%li= link_to "Reject event (WITH email)", update_state_admin_conference_event_path(@conference.short_title, event, :transition => :reject, :send_mail => true),
:method => :put, :confirm => "Are you sure?",
:hint => "Reject this event and send an automated email."
- if event.transition_possible? :start_review
%li= link_to "Start review", update_state_admin_conference_event_path(@conference.short_title, event, :transition => :start_review),
:method => :put
- if @event.transition_possible? :confirm
%li= link_to "Confirm event", update_state_admin_conference_event_path(@conference.short_title, @event, :transition => :confirm),
- if event.transition_possible? :confirm
%li= link_to "Confirm event", update_state_admin_conference_event_path(@conference.short_title, event, :transition => :confirm),
:method => :put, :hint => "Confirm that the speaker(s) will be present and that the event will actually take place."
- if @event.transition_possible? :cancel
%li= link_to "Cancel event", update_state_admin_conference_event_path(@conference.short_title, @event, :transition => :cancel),
- if event.transition_possible? :cancel
%li= link_to "Cancel event", update_state_admin_conference_event_path(@conference.short_title, event, :transition => :cancel),
:method => :put, :hint => "Mark this event as cancelled. Usually this means that the speakers had to cancel their appearance."
%tr
%td

View file

@ -33,10 +33,15 @@
- if event.transition_possible? :accept
%li= link_to "Accept event (no email)", update_state_admin_conference_event_path(@conference.short_title, event, :transition => :accept, :send_mail => false),
:method => :put, :hint => "Accept this event without sending an automated email."
%li= link_to "Accept event (WITH email)", update_state_admin_conference_event_path(@conference.short_title, event, :transition => :accept, :send_mail => true),
:method => :put, :hint => "Accept this event and send an automated email."
- if event.transition_possible? :reject
%li= link_to "Reject event (no email)", update_state_admin_conference_event_path(@conference.short_title, event, :transition => :reject, :send_mail => false),
:method => :put, :confirm => "Are you sure?",
:hint => "Reject this event without sending an automated email."
%li= link_to "Reject event (WITH email)", update_state_admin_conference_event_path(@conference.short_title, event, :transition => :reject, :send_mail => true),
:method => :put, :confirm => "Are you sure?",
:hint => "Reject this event and send an automated email."
- if event.transition_possible? :start_review
%li= link_to "Start review", update_state_admin_conference_event_path(@conference.short_title, event, :transition => :start_review),
:method => :put