summaryrefslogtreecommitdiff
path: root/engines/support/app/controllers
diff options
context:
space:
mode:
Diffstat (limited to 'engines/support/app/controllers')
-rw-r--r--engines/support/app/controllers/tickets_controller.rb8
1 files changed, 8 insertions, 0 deletions
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