From 63871baf6061668b162972193c55b5a8f7490797 Mon Sep 17 00:00:00 2001 From: elijah Date: Thu, 30 Apr 2015 00:32:33 -0700 Subject: added support for email notifications of ticket changes --- engines/support/app/controllers/tickets_controller.rb | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'engines/support/app/controllers') diff --git a/engines/support/app/controllers/tickets_controller.rb b/engines/support/app/controllers/tickets_controller.rb index 602bbd9..c1abfa2 100644 --- a/engines/support/app/controllers/tickets_controller.rb +++ b/engines/support/app/controllers/tickets_controller.rb @@ -62,6 +62,7 @@ class TicketsController < ApplicationController if @ticket.comments_changed? @ticket.comments.last.posted_by = current_user.id @ticket.comments.last.private = false unless admin? + send_email_update(@ticket, @ticket.comments.last) end flash_for @ticket, with_errors: true @@ -153,4 +154,11 @@ class TicketsController < ApplicationController ) end + def send_email_update(ticket, comment) + TicketMailer.send_notice(ticket, comment, ticket_url(ticket)) + rescue StandardError => exc + flash_for(exc) + raise exc if Rails.env == 'development' + end + end -- cgit v1.2.3