Class: Admin::MessagesController
- Inherits:
-
ResourceController
- Object
- ResourceController
- Admin::MessagesController
- Defined in:
- app/controllers/admin/messages_controller.rb
Instance Method Summary collapse
- #deliver ⇒ Object
-
#preview ⇒ Object
mock email view called into an iframe in the :show view the view calls @message.preview, which returns the message body.
-
#show ⇒ Object
here :show is the preview/send page continue_url is extended below to redirect to show rather than index after editing.
Instance Method Details
#deliver ⇒ Object
20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 |
# File 'app/controllers/admin/messages_controller.rb', line 20 def deliver case params['delivery'] when "all" @readers = @message.possible_readers when "inactive" @readers = @message.inactive_readers when "unsent" @readers = @message.undelivered_readers when "selected" @readers = @message.possible_readers.find(params['recipients']) else redirect_to (@message) return end failures = @message.deliver(@readers) || [] if failures.any? if failures.length == @readers.length flash[:error] = t("reader_extension.all_deliveries_failed") else addresses = failures.map(&:email).to_sentence flash[:notice] = t("reader_extension.some_deliveries_failed") end else flash[:notice] = t("reader_extension.message_delivered") end redirect_to (@message) end |
#preview ⇒ Object
mock email view called into an iframe in the :show view the view calls @message.preview, which returns the message body
16 17 18 |
# File 'app/controllers/admin/messages_controller.rb', line 16 def preview render :layout => false end |
#show ⇒ Object
here :show is the preview/send page continue_url is extended below to redirect to show rather than index after editing.
10 11 12 |
# File 'app/controllers/admin/messages_controller.rb', line 10 def show end |